+ String maxWdmHc = null;
+ if (soft.getMaxWdmHopCount() != null && hard.getMaxWdmHopCount() != null) {
+ maxWdmHc = soft.getMaxWdmHopCount().intValue() <= hard.getMaxWdmHopCount().intValue()
+ ? soft.getMaxWdmHopCount().toString()
+ : hard.getMaxWdmHopCount().toString();
+ } else if (hard.getMaxWdmHopCount() != null) {
+ maxWdmHc = hard.getMaxWdmHopCount().toString();
+ } else if (soft.getMaxWdmHopCount() != null) {
+ maxWdmHc = soft.getMaxWdmHopCount().toString();
+ }
+ String maxOtnHc = null;
+ if (soft.getMaxOtnHopCount() != null && hard.getMaxOtnHopCount() != null) {
+ maxOtnHc = soft.getMaxOtnHopCount().intValue() <= hard.getMaxOtnHopCount().intValue()
+ ? soft.getMaxOtnHopCount().toString()
+ : hard.getMaxOtnHopCount().toString();
+ } else if (hard.getMaxOtnHopCount() != null) {
+ maxOtnHc = hard.getMaxOtnHopCount().toString();
+ } else if (soft.getMaxOtnHopCount() != null) {
+ maxOtnHc = soft.getMaxOtnHopCount().toString();
+ }
+ HopCountBuilder hcBldr = new HopCountBuilder();
+ if (maxWdmHc != null) {
+ hcBldr.setMaxWdmHopCount(Uint8.valueOf(maxWdmHc));
+ }
+ if (maxOtnHc != null) {
+ hcBldr.setMaxWdmHopCount(Uint8.valueOf(maxOtnHc));
+ }
+ return hcBldr.build();
+ }
+
+ private static TEMetric updateTEMetric(TEMetric hard, TEMetric soft) {
+ if (soft == null) {
+ return new TEMetricBuilder(hard).build();
+ }
+ String maxWdmTem = null;
+ if (soft.getMaxWdmTEMetric() != null && hard.getMaxWdmTEMetric() != null) {
+ maxWdmTem = soft.getMaxWdmTEMetric().intValue() <= hard.getMaxWdmTEMetric().intValue()
+ ? soft.getMaxWdmTEMetric().toString()
+ : hard.getMaxWdmTEMetric().toString();
+ } else if (hard.getMaxWdmTEMetric() != null) {
+ maxWdmTem = hard.getMaxWdmTEMetric().toString();
+ } else if (soft.getMaxWdmTEMetric() != null) {
+ maxWdmTem = soft.getMaxWdmTEMetric().toString();
+ }
+ String maxOtnTem = null;
+ if (soft.getMaxOtnTEMetric() != null && hard.getMaxOtnTEMetric() != null) {
+ maxOtnTem = soft.getMaxOtnTEMetric().intValue() <= hard.getMaxOtnTEMetric().intValue()
+ ? soft.getMaxOtnTEMetric().toString()
+ : hard.getMaxOtnTEMetric().toString();
+ } else if (hard.getMaxOtnTEMetric() != null) {
+ maxOtnTem = hard.getMaxOtnTEMetric().toString();
+ } else if (soft.getMaxOtnTEMetric() != null) {
+ maxOtnTem = soft.getMaxOtnTEMetric().toString();
+ }
+ TEMetricBuilder temBldr = new TEMetricBuilder();
+ if (maxWdmTem != null) {
+ temBldr.setMaxWdmTEMetric(Uint32.valueOf(maxWdmTem));
+ }
+ if (maxOtnTem != null) {
+ temBldr.setMaxOtnTEMetric(Uint32.valueOf(maxOtnTem));
+ }
+ return temBldr.build();