Class FileAttribute<T>

  • Type Parameters:
    T - type of the value

    public class FileAttribute<T>
    extends java.lang.Object
    A (type, type_display_string, value) tuple.
    • Method Detail

      • create

        public static <T> FileAttribute<T> create​(java.lang.String name,
                                                  T attributeValue)
        Creates a new FileAttribute instance with an FileAttributeType.UNKNOWN_ATTRIBUTE type and the specified display name.
        Type Parameters:
        T - type of the value
        Parameters:
        name - custom display name for the value
        attributeValue - value (should be .toString()'able)
        Returns:
        new FileAttribute instance
      • create

        public static <T> FileAttribute<T> create​(FileAttributeType attributeType,
                                                  java.lang.String attributeDisplayName,
                                                  T attributeValue)
        Creates a new FileAttribute instance with the specified type, display name and value.
        Type Parameters:
        T - type of the value
        Parameters:
        attributeType - FileAttributeType type
        attributeDisplayName - display name of the type
        attributeValue - value (should match the type specified in FileAttributeType.getValueType())
        Returns:
        new FileAttribute instance
      • getAttributeDisplayName

        public java.lang.String getAttributeDisplayName()
        Returns the display name of this instance. This is usually derived from the FileAttributeType.getDisplayName().
        Returns:
        string display name
      • getAttributeValue

        public T getAttributeValue()
        Return the value.
        Returns:
        value
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object