Class AttributeConverter.Factory

java.lang.Object
org.jboss.as.controller.transform.description.AttributeConverter.Factory
Enclosing interface:
AttributeConverter

public static class AttributeConverter.Factory extends Object
Factory for common types of AttributeConverters
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createHardCoded(org.jboss.dmr.ModelNode hardCodedValue)
    Creates an AttributeConverter where the conversion is to a hard-coded value
    createHardCoded(org.jboss.dmr.ModelNode hardCodedValue, boolean undefinedOnly)
    Creates an AttributeConverter where the conversion is to a hard-coded value, with the ability to restrict the conversion to cases where the value being converted is ModelType.UNDEFINED.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • createHardCoded

      public static AttributeConverter createHardCoded(org.jboss.dmr.ModelNode hardCodedValue)
      Creates an AttributeConverter where the conversion is to a hard-coded value
      Parameters:
      hardCodedValue - the value to set the attribute to
      Returns:
      the created attribute converter
    • createHardCoded

      public static AttributeConverter createHardCoded(org.jboss.dmr.ModelNode hardCodedValue, boolean undefinedOnly)
      Creates an AttributeConverter where the conversion is to a hard-coded value, with the ability to restrict the conversion to cases where the value being converted is ModelType.UNDEFINED.

      The expected use case for setting the undefinedOnly param to true is to ensure a legacy slave sees the correct value following a change in a default between releases. If the attribute being converted is undefined, then the default value is relevant, and in order to function consistently with newer slaves, the legacy slave will need to be given the new default in place of "undefined".

      Parameters:
      hardCodedValue - the value to set the attribute to
      undefinedOnly - true if the conversion should only occur if the attributeValue param is ModelType.UNDEFINED
      Returns:
      the created attribute converter