Guest User

Untitled

a guest
Jan 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. SimpleAttributeDefinition TRANSACTION = SimpleAttributeDefinitionBuilder.create("transaction", STRING)
  2. .setDefaultValue(new ModelNode().set(CommonAttributes.XA))
  3. .setCorrector(new ParameterCorrector() {
  4. @Override
  5. public ModelNode correct(ModelNode newValue, ModelNode currentValue) {
  6. if (newValue.isDefined() && (newValue.asString().equals(CommonAttributes.LOCAL) || newValue.asString().equals(CommonAttributes.NONE))) {
  7. return newValue;
  8. } else {
  9. return new ModelNode(CommonAttributes.XA);
  10. }
  11. }
  12. })
  13. .setValidator(new StringAllowedValuesValidator(CommonAttributes.LOCAL, CommonAttributes.NONE, CommonAttributes.XA))
Add Comment
Please, Sign In to add comment