Class MetadataImpl<T>

java.lang.Object
org.jboss.weld.bootstrap.spi.helpers.MetadataImpl<T>
Type Parameters:
T - the type of metadata
All Implemented Interfaces:
Metadata<T>

public class MetadataImpl<T> extends Object implements Metadata<T>
Basic implementation of Metadata
  • Field Details

    • LOCATION_NOT_AVAILABLE

      public static final String LOCATION_NOT_AVAILABLE
      Constant used to declare that the metadata location is not available
      See Also:
  • Constructor Details

    • MetadataImpl

      public MetadataImpl(T value)
      Parameters:
      value - type of metadata that this class holds
    • MetadataImpl

      public MetadataImpl(T value, String location)
      Parameters:
      value - type of metadata that this class holds
      location - String representation of where is this metadata stored
  • Method Details

    • from

      public static <T> MetadataImpl<T> from(T value)
      Constructs Metadata from given value. Metadata location is set to LOCATION_NOT_AVAILABLE
      Type Parameters:
      T - metadata type
      Parameters:
      value - metadata value
      Returns:
      instance of metadata
    • getLocation

      public String getLocation()
      Description copied from interface: Metadata
      The location of the metadata, used in error and log messages
      Specified by:
      getLocation in interface Metadata<T>
      Returns:
      location of the metadata, used in error and log messages
    • getValue

      public T getValue()
      Description copied from interface: Metadata
      The metadata value
      Specified by:
      getValue in interface Metadata<T>
      Returns:
      the metadata value
    • toString

      public String toString()
      Overrides:
      toString in class Object