@Test public void toNodeRoleDimension() { NodeRoleDimensionBean dimBean = new NodeRoleDimensionBean(NodeRoleDimension.builder("name").build(), null); NodeRoleDimension dim = dimBean.toNodeRoleDimension(); assertThat(dim, equalTo(NodeRoleDimension.builder().setName("name").build())); }
public NodeRoleDimension toNodeRoleDimension() { List<RoleDimensionMapping> rdMappings = new LinkedList<>(); rdMappings.addAll( roleDimensionMappings.stream() .map(RoleDimensionMappingBean::toRoleDimensionMapping) .collect(ImmutableList.toImmutableList())); rdMappings.addAll( roles.stream() .map(NodeRoleBean::toNodeRole) .map(RoleDimensionMapping::new) .collect(ImmutableList.toImmutableList())); return NodeRoleDimension.builder().setName(name).setRoleDimensionMappings(rdMappings).build(); }
NodeRoleDimensionBean { public NodeRoleDimension toNodeRoleDimension() { List<RoleDimensionMapping> rdMappings = new LinkedList<>(); rdMappings.addAll( roleDimensionMappings.stream() .map(RoleDimensionMappingBean::toRoleDimensionMapping) .collect(ImmutableList.toImmutableList())); rdMappings.addAll( roles.stream() .map(NodeRoleBean::toNodeRole) .map(RoleDimensionMapping::new) .collect(ImmutableList.toImmutableList())); return NodeRoleDimension.builder().setName(name).setRoleDimensionMappings(rdMappings).build(); } }
NodeRoleDimensionBean { public NodeRoleDimension toNodeRoleDimension() { List<RoleDimensionMapping> rdMappings = new LinkedList<>(); rdMappings.addAll( roleDimensionMappings.stream() .map(RoleDimensionMappingBean::toRoleDimensionMapping) .collect(ImmutableList.toImmutableList())); rdMappings.addAll( roles.stream() .map(NodeRoleBean::toNodeRole) .map(RoleDimensionMapping::new) .collect(ImmutableList.toImmutableList())); return NodeRoleDimension.builder().setName(name).setRoleDimensionMappings(rdMappings).build(); } @JsonCreator private  NodeRoleDimensionBean();  NodeRoleDimensionBean(NodeRoleDimension nrDim, String snapshot); }
NodeRoleDimensionBean { public NodeRoleDimension toNodeRoleDimension() { List<RoleDimensionMapping> rdMappings = new LinkedList<>(); rdMappings.addAll( roleDimensionMappings.stream() .map(RoleDimensionMappingBean::toRoleDimensionMapping) .collect(ImmutableList.toImmutableList())); rdMappings.addAll( roles.stream() .map(NodeRoleBean::toNodeRole) .map(RoleDimensionMapping::new) .collect(ImmutableList.toImmutableList())); return NodeRoleDimension.builder().setName(name).setRoleDimensionMappings(rdMappings).build(); } @JsonCreator private  NodeRoleDimensionBean();  NodeRoleDimensionBean(NodeRoleDimension nrDim, String snapshot); @Override boolean equals(Object o); @Override int hashCode(); NodeRoleDimension toNodeRoleDimension(); @Override String toString(); }
NodeRoleDimensionBean { public NodeRoleDimension toNodeRoleDimension() { List<RoleDimensionMapping> rdMappings = new LinkedList<>(); rdMappings.addAll( roleDimensionMappings.stream() .map(RoleDimensionMappingBean::toRoleDimensionMapping) .collect(ImmutableList.toImmutableList())); rdMappings.addAll( roles.stream() .map(NodeRoleBean::toNodeRole) .map(RoleDimensionMapping::new) .collect(ImmutableList.toImmutableList())); return NodeRoleDimension.builder().setName(name).setRoleDimensionMappings(rdMappings).build(); } @JsonCreator private  NodeRoleDimensionBean();  NodeRoleDimensionBean(NodeRoleDimension nrDim, String snapshot); @Override boolean equals(Object o); @Override int hashCode(); NodeRoleDimension toNodeRoleDimension(); @Override String toString(); public String name; public List<NodeRoleBean> roles; public List<RoleDimensionMappingBean> roleDimensionMappings; public String snapshot; }