Class Metadata


  • public final class Metadata
    extends java.lang.Object
    • Constructor Detail

      • Metadata

        public Metadata​(int id,
                        MetaType metaType,
                        @Nullable java.lang.Object value)
        Creates a new metadata instance.
        Parameters:
        id - metadata index
        metaType - metadata type
        value - value if present
        Throws:
        java.lang.IllegalArgumentException - if the value and metaType are incompatible
    • Method Detail

      • id

        public int id()
      • setId

        public void setId​(int id)
      • setMetaType

        public void setMetaType​(MetaType metaType)
        Sets the metadata type if compatible with the current value.
        Parameters:
        metaType - metadata type
        Throws:
        java.lang.IllegalArgumentException - if the metadata type and current value are incompatible
        See Also:
        setTypeAndValue(MetaType, Object)
      • value

        public <T> @Nullable T value()
      • getValue

        public @Nullable java.lang.Object getValue()
      • setValue

        public void setValue​(@Nullable java.lang.Object value)
        Sets the metadata value if compatible with the current meta type.
        Parameters:
        value - value
        Throws:
        java.lang.IllegalArgumentException - if the value and current metaType are incompatible
        See Also:
        setTypeAndValue(MetaType, Object)
      • setTypeAndValue

        public void setTypeAndValue​(MetaType metaType,
                                    @Nullable java.lang.Object value)
        Sets metadata type and value.
        Parameters:
        metaType - metadata type
        value - value
        Throws:
        java.lang.IllegalArgumentException - if the value and metaType are incompatible
      • setMetaTypeUnsafe

        @Deprecated
        public void setMetaTypeUnsafe​(MetaType type)
        Deprecated.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object