Interface ExtendedAttribute<T>

  • Type Parameters:
    T - The type of object to encode/decode
    All Known Implementing Classes:
    AbstractExtendedAttribute

    public interface ExtendedAttribute<T>
    This class defines an interface for implementing an extended attribute which can be stored on inodes. Attributes are stored on inodes as a simple array of byte and define their implementations for encoding/decoding
    • Method Detail

      • getName

        java.lang.String getName()
        Returns:
        the full attribute with namespace and identifier
      • getNamespace

        java.lang.String getNamespace()
        Returns:
        the namespace of the attribute lies within
      • getIdentifier

        java.lang.String getIdentifier()
        Returns:
        the identifier within the namespace of the attribute
      • encode

        byte[] encode​(T object)
        Encode a single object into a byte string.
        Parameters:
        object - the object to encode
        Returns:
        the byte representation of the object
      • decode

        T decode​(byte[] bytes)
          throws java.io.IOException
        Decode an object from a single byte string.
        Parameters:
        bytes - the bytes to decode into a single instance of
        Returns:
        the instance of the decoded object
        Throws:
        java.io.IOException - if the size of the byte string isn't equal to the encoding length