Class PropertyFactory

java.lang.Object
xbot.common.properties.PropertyFactory

public class PropertyFactory extends Object
A factory for creating properties. This is the preferred way to create properties.
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
  • Method Details

    • setPrefix

      public void setPrefix(String prefix)
      Sets the prefix for all properties created by this factory. This or another prefix setting method must be called before any properties are created.
      Parameters:
      prefix - The prefix to use for all properties created by this factory.
    • setPrefix

      public void setPrefix(IPropertySupport prefixSource)
      Sets the prefix for all properties created by this factory. This or another prefix setting method must be called before any properties are created.
      Parameters:
      prefixSource - The prefix source to use for the prefix.
    • appendPrefix

      public void appendPrefix(String toAppend)
      Appends a prefix to the current prefix for all properties created by this factory. This or another prefix setting method must be called before any properties are created.
      Parameters:
      toAppend - The prefix to append to the current prefix.
    • setTopLevelPrefix

      public void setTopLevelPrefix()
      Sets the prefix for all properties created by this factory to the top level. This or another prefix setting method must be called before any properties are created.
    • getPrefix

      public String getPrefix()
      Gets the prefix for all properties created by this factory.
      Returns:
      The prefix for all properties created by this factory.
    • getCleanPrefix

      public String getCleanPrefix()
    • setDefaultLevel

      public void setDefaultLevel(Property.PropertyLevel level)
      Sets the default property level.
      Parameters:
      level - The property level.
    • createPersistentProperty

      public BooleanProperty createPersistentProperty(String suffix, boolean defaultValue)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      Returns:
      The property.
    • createPersistentProperty

      public BooleanProperty createPersistentProperty(String suffix, boolean defaultValue, Property.PropertyLevel level)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      level - The property level.
      Returns:
      The property.
    • createPersistentProperty

      public StringProperty createPersistentProperty(String suffix, String defaultValue)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      Returns:
      The property.
    • createPersistentProperty

      public StringProperty createPersistentProperty(String suffix, String defaultValue, Property.PropertyLevel level)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      level - The property level.
      Returns:
      The property.
    • createPersistentProperty

      public DoubleProperty createPersistentProperty(String suffix, double defaultValue)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      Returns:
      The property.
    • createPersistentProperty

      public DoubleProperty createPersistentProperty(String suffix, double defaultValue, Property.PropertyLevel level)
      Method for creating a double persistent property.
      Parameters:
      suffix - The suffix for the property.
      defaultValue - The default value for the property.
      level - The property level.
      Returns:
      The property.