@Test public void testGetGradoopId() throws Exception { PropertyValue p = PropertyValue.create(GRADOOP_ID_VAL_8); assertEquals(GRADOOP_ID_VAL_8, p.getGradoopId()); }
@Test public void testSetGradoopId() throws Exception { PropertyValue p = new PropertyValue(); p.setGradoopId(GRADOOP_ID_VAL_8); assertEquals(GRADOOP_ID_VAL_8, p.getGradoopId()); }
@Override public int compareTo(PropertyValue o) { int result; if (this.isNull() && o.isNull()) { result = 0; } else if (this.isNumber() && o.isNumber()) { result = PropertyValueUtils.Numeric.compare(this, o); } else if (this.isBoolean() && o.isBoolean()) { result = Boolean.compare(this.getBoolean(), o.getBoolean()); } else if (this.isString() && o.isString()) { result = this.getString().compareTo(o.getString()); } else if (this.isGradoopId() && o.isGradoopId()) { result = this.getGradoopId().compareTo(o.getGradoopId()); } else if (this.isDate() && o.isDate()) { result = this.getDate().compareTo(o.getDate()); } else if (this.isTime() && o.isTime()) { result = this.getTime().compareTo(o.getTime()); } else if (this.isDateTime() && o.isDateTime()) { result = this.getDateTime().compareTo(o.getDateTime()); } else if (this.isMap() || o.isMap() || this.isList() || o.isList() || this.isSet() || o.isSet()) { throw new UnsupportedOperationException(String.format( "Method compareTo() is not supported for %s, %s", this.getClass(), o.getClass())); } else { throw new IllegalArgumentException(String.format( "Incompatible types: %s, %s", this.getClass(), o.getClass())); } return result; }
int eCount = 0; for (GraphHead head : resultHeads) { GradoopId id = head.getPropertyValue("lineage").getGradoopId(); if (lineageIdMap.get(id).equals("A")) { aCount++;
@Test public void testVariableMappingCreation() throws Exception { AddGraphElementToNewGraph<Vertex> udf = new AddGraphElementToNewGraph<>(new GraphHeadFactory(), "a"); Vertex vertex = new VertexFactory().createVertex(); Tuple2<Vertex, GraphHead> result = udf.map(vertex); assertTrue(result.f1.hasProperty(PatternMatching.VARIABLE_MAPPING_KEY)); Map<PropertyValue, PropertyValue> variableMapping = result.f1.getPropertyValue(PatternMatching.VARIABLE_MAPPING_KEY).getMap(); assertEquals(vertex.getId(), variableMapping.get(PropertyValue.create("a")).getGradoopId()); } }
/** * Returns the wrapped value as object. * * @return value or {@code null} if the value is empty */ public Object getObject() { return isBoolean() ? getBoolean() : isShort() ? getShort() : isInt() ? getInt() : isLong() ? getLong() : isFloat() ? getFloat() : isDouble() ? getDouble() : isString() ? getString() : isBigDecimal() ? getBigDecimal() : isGradoopId() ? getGradoopId() : isMap() ? getMap() : isList() ? getList() : isDate() ? getDate() : isTime() ? getTime() : isDateTime() ? getDateTime() : isSet() ? getSet() : null; } /**
assertEquals(epgmElement.getPropertyValue(GradoopTestUtils.KEY_5).getString(), PROPERTY_MAP.get(GradoopTestUtils.KEY_5)); assertEquals(epgmElement.getPropertyValue(GradoopTestUtils.KEY_6).getGradoopId(), PROPERTY_MAP.get(GradoopTestUtils.KEY_6)); assertEquals(epgmElement.getPropertyValue(GradoopTestUtils.KEY_7).getDate(),
case KEY_8: assertTrue(v.getPropertyValue(propertyKey).isGradoopId()); assertEquals(GRADOOP_ID_VAL_8, v.getPropertyValue(propertyKey).getGradoopId()); break; case KEY_9:
case KEY_8: assertTrue(v.getPropertyValue(propertyKey).isGradoopId()); assertEquals(GRADOOP_ID_VAL_8, v.getPropertyValue(propertyKey).getGradoopId()); break; case KEY_9:
assertEquals(GRADOOP_ID_VAL_8, p.getGradoopId());