Uploaded image for project: 'DMR'
  1. DMR
  2. DMR-35

ModelNode Constants

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 1.5.0.Final
    • None
    • None

      Add a few constants to the ModelNode class to hold unmodifiable nodes for a few common cases:

      public static final ModelNode TRUE = new ModelNode(true).protect();
      public static final ModelNode FALSE = new ModelNode(false).protect();
      public static final ModelNode ZERO = new ModelNode(0).protect();

      Specific use case is the hundreds of examples of this kind of thing in WildFly where we could use a constant for declaring default values:

      static final AttributeDefinition FOO = new SimpleAttributeDefinitionBuilder("foo", ModelType.BOOLEAN)
          .setRequired(false)
          .setDefaultValue(ModelNode.TRUE)
          .build();
      

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: