Class AttributeConverter.Factory

  • Enclosing interface:
    AttributeConverter

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

      • Factory

        public Factory()
    • Method Detail

      • 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