Class DefaultMetadata

  • All Implemented Interfaces:
    Metadata

    public class DefaultMetadata
    extends java.lang.Object
    implements Metadata
    The default implementation of Metadata
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DefaultMetadata​(java.lang.String name, java.lang.String description, java.lang.String unit)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> description()  
      boolean equals​(java.lang.Object o)  
      java.lang.String getDescription()
      Returns the description of the metric if set, otherwise this method returns the empty String.
      java.lang.String getName()
      Returns the metric name.
      java.lang.String getUnit()
      Returns the unit of this metric if set, otherwise this method returns MetricUnits.NONE
      int hashCode()  
      java.lang.String toString()  
      java.util.Optional<java.lang.String> unit()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultMetadata

        protected DefaultMetadata​(java.lang.String name,
                                  java.lang.String description,
                                  java.lang.String unit)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Metadata
        Returns the metric name.
        Specified by:
        getName in interface Metadata
        Returns:
        the metric name.
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Metadata
        Returns the description of the metric if set, otherwise this method returns the empty String.
        Specified by:
        getDescription in interface Metadata
        Returns:
        the description
      • description

        public java.util.Optional<java.lang.String> description()
        Specified by:
        description in interface Metadata
      • getUnit

        public java.lang.String getUnit()
        Description copied from interface: Metadata
        Returns the unit of this metric if set, otherwise this method returns MetricUnits.NONE
        Specified by:
        getUnit in interface Metadata
        Returns:
        the unit
      • unit

        public java.util.Optional<java.lang.String> unit()
        Specified by:
        unit in interface Metadata
      • 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