Class PropertyModule

java.lang.Object
org.opt4j.config.PropertyModule
All Implemented Interfaces:
com.google.inject.Module, Serializable, Comparable<PropertyModule>

public final class PropertyModule extends Object implements com.google.inject.Module, Serializable, Comparable<PropertyModule>
The PropertyModule is a decorator for a Module that enables property methods.
See Also:
  • Field Details

    • module

      protected final com.google.inject.Module module
    • properties

      protected final List<Property> properties
    • c

      protected static int c
    • id

      public final int id
  • Constructor Details

    • PropertyModule

      public PropertyModule(com.google.inject.Module module)
      Constructs a PropertyModule that decorates a Module.
      Parameters:
      module - the decorated module
  • Method Details

    • toEnumElement

      public static Object toEnumElement(String name, Class<? extends Enum> type)
      Converts a String to an element of a given enumeration.
      Parameters:
      name - the name of the element
      type - the enumeration type
      Returns:
      the element of the enumeration
    • configure

      public void configure(com.google.inject.Binder binder)
      Specified by:
      configure in interface com.google.inject.Module
    • getModule

      public com.google.inject.Module getModule()
      Returns the decorated Module.
      Returns:
      the module
    • getProperty

      public Property getProperty(String name)
      Returns the Property with the specified name.
      Parameters:
      name - the name of the property
      Returns:
      the property with the specified name
    • getProperties

      public List<Property> getProperties()
      Returns the properties.
      Returns:
      the properties
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setConfiguration

      public void setConfiguration(Node node)
      Configures a PropertyModule with an XML Node.
      Parameters:
      node - the configuration as XML node
      See Also:
    • getConfiguration

      public Node getConfiguration(Document document)
      Returns the configuration of the PropertyModule as XML Node.
      Parameters:
      document - the XML document
      Returns:
      the configuration as XML node
      See Also:
    • clone

      public PropertyModule clone()
      Overrides:
      clone in class Object
    • compareTo

      public int compareTo(PropertyModule other)
      Specified by:
      compareTo in interface Comparable<PropertyModule>
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object