@Test public void whoami() { ModelNode op = new ModelNode(); op.get(Constants.OP).set(Constants.WHOAMI); op.get(Constants.OP_ADDR).setEmptyList(); assertEquals("/:whoami", ModelNodeOperationToCliString.convert(op)); }
static String convert(ModelNode op) { try { String operation = op.get(Constants.OP).asString(); if (!Constants.COMPOSITE.equals(operation)) { return convertSingleOperation(op); } else { StringBuilder result = new StringBuilder("composite: "); boolean first = true; for (ModelNode singleOp : op.get(Constants.STEPS).asList()) { if (!first) { result.append(", "); } first = false; result.append(convertSingleOperation(singleOp)); } return result.toString(); } } catch (Exception e) { return op.asString(); } }
ModelNodeOperationToCliString { static String convert(ModelNode op) { try { String operation = op.get(Constants.OP).asString(); if (!Constants.COMPOSITE.equals(operation)) { return convertSingleOperation(op); } else { StringBuilder result = new StringBuilder("composite: "); boolean first = true; for (ModelNode singleOp : op.get(Constants.STEPS).asList()) { if (!first) { result.append(", "); } first = false; result.append(convertSingleOperation(singleOp)); } return result.toString(); } } catch (Exception e) { return op.asString(); } } }
ModelNodeOperationToCliString { static String convert(ModelNode op) { try { String operation = op.get(Constants.OP).asString(); if (!Constants.COMPOSITE.equals(operation)) { return convertSingleOperation(op); } else { StringBuilder result = new StringBuilder("composite: "); boolean first = true; for (ModelNode singleOp : op.get(Constants.STEPS).asList()) { if (!first) { result.append(", "); } first = false; result.append(convertSingleOperation(singleOp)); } return result.toString(); } } catch (Exception e) { return op.asString(); } } private  ModelNodeOperationToCliString(); }
ModelNodeOperationToCliString { static String convert(ModelNode op) { try { String operation = op.get(Constants.OP).asString(); if (!Constants.COMPOSITE.equals(operation)) { return convertSingleOperation(op); } else { StringBuilder result = new StringBuilder("composite: "); boolean first = true; for (ModelNode singleOp : op.get(Constants.STEPS).asList()) { if (!first) { result.append(", "); } first = false; result.append(convertSingleOperation(singleOp)); } return result.toString(); } } catch (Exception e) { return op.asString(); } } private  ModelNodeOperationToCliString();  }
ModelNodeOperationToCliString { static String convert(ModelNode op) { try { String operation = op.get(Constants.OP).asString(); if (!Constants.COMPOSITE.equals(operation)) { return convertSingleOperation(op); } else { StringBuilder result = new StringBuilder("composite: "); boolean first = true; for (ModelNode singleOp : op.get(Constants.STEPS).asList()) { if (!first) { result.append(", "); } first = false; result.append(convertSingleOperation(singleOp)); } return result.toString(); } } catch (Exception e) { return op.asString(); } } private  ModelNodeOperationToCliString();   }