diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java index 01a15304a9..96c9e2ff83 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java @@ -24,42 +24,39 @@ import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.item.Relation; import com.amdocs.zusammen.datatypes.item.RelationEdge; - import java.util.stream.Collectors; public class VlmZusammenUtil { - static ZusammenElement getZusammenElement(ElementInfo elementInfo) { - ZusammenElement zusammenElement = new ZusammenElement(); - zusammenElement.setElementId(elementInfo.getId()); - zusammenElement.setInfo(elementInfo.getInfo()); - zusammenElement.setRelations(elementInfo.getRelations()); - zusammenElement.setSubElements(elementInfo.getSubElements().stream() - .map(VlmZusammenUtil::getZusammenElement) - .collect(Collectors.toList())); - return zusammenElement; - } - - public static Relation createRelation(RelationType type, String to) { - Relation relation = new Relation(); - relation.setType(type.name()); - RelationEdge edge2 = new RelationEdge(); - edge2.setElementId(new Id(to)); - relation.setEdge2(edge2); - return relation; - } + static ZusammenElement getZusammenElement(ElementInfo elementInfo) { + ZusammenElement zusammenElement = new ZusammenElement(); + zusammenElement.setElementId(elementInfo.getId()); + zusammenElement.setInfo(elementInfo.getInfo()); + zusammenElement.setRelations(elementInfo.getRelations()); + zusammenElement.setSubElements(elementInfo.getSubElements().stream().map(VlmZusammenUtil::getZusammenElement).collect(Collectors.toList())); + return zusammenElement; + } - public static Integer toInteger(Object val) { - if (val == null) { - return null; + public static Relation createRelation(RelationType type, String to) { + Relation relation = new Relation(); + relation.setType(type.name()); + RelationEdge edge2 = new RelationEdge(); + edge2.setElementId(new Id(to)); + relation.setEdge2(edge2); + return relation; } - if (val instanceof Double) { - return ((Double) val).intValue(); - } else if (val instanceof String) { - return new Integer((String) val); - } else if (val instanceof Integer) { - return (Integer) val; + + public static Integer toInteger(Object val) { + if (val == null) { + return null; + } + if (val instanceof Double) { + return ((Double) val).intValue(); + } else if (val instanceof String) { + return new Integer((String) val); + } else if (val instanceof Integer) { + return (Integer) val; + } + throw new RuntimeException("invalid value for integer:" + val.getClass()); } - throw new RuntimeException("invalid value for integer:" + val.getClass()); - } } |