@Test public void convertMakesAnExplicitPredicate() { ExplicitField field = new ExplicitField("test:test", false, null, null); Predicate predicate = field.convertToPredicate(); assertThat(predicate.isExplicit(), is(true)); }
public Predicate convertToPredicate() { Map<String, Long> valueTypes = new HashMap<>(); Map<String, Long> referenceTypes = new HashMap<>(); if (values != null) { for (String value : values) { valueTypes.put(value, 0L); } } if (references != null) { for (String reference : references) { referenceTypes.put(reference, 0L); } } Predicate convertedPredicate = new Predicate(uri, Direction.OUT); convertedPredicate.setIsExplicit(true); convertedPredicate.setIsList(isList); convertedPredicate.setValueTypes(valueTypes); convertedPredicate.setReferenceTypes(referenceTypes); return convertedPredicate; }
ExplicitField { public Predicate convertToPredicate() { Map<String, Long> valueTypes = new HashMap<>(); Map<String, Long> referenceTypes = new HashMap<>(); if (values != null) { for (String value : values) { valueTypes.put(value, 0L); } } if (references != null) { for (String reference : references) { referenceTypes.put(reference, 0L); } } Predicate convertedPredicate = new Predicate(uri, Direction.OUT); convertedPredicate.setIsExplicit(true); convertedPredicate.setIsList(isList); convertedPredicate.setValueTypes(valueTypes); convertedPredicate.setReferenceTypes(referenceTypes); return convertedPredicate; } }
ExplicitField { public Predicate convertToPredicate() { Map<String, Long> valueTypes = new HashMap<>(); Map<String, Long> referenceTypes = new HashMap<>(); if (values != null) { for (String value : values) { valueTypes.put(value, 0L); } } if (references != null) { for (String reference : references) { referenceTypes.put(reference, 0L); } } Predicate convertedPredicate = new Predicate(uri, Direction.OUT); convertedPredicate.setIsExplicit(true); convertedPredicate.setIsList(isList); convertedPredicate.setValueTypes(valueTypes); convertedPredicate.setReferenceTypes(referenceTypes); return convertedPredicate; } @JsonCreator  ExplicitField(@JsonProperty("uri") String uri,
                       @JsonProperty("isList") boolean isList,
                       @JsonProperty("values") Set<String> values,
                       @JsonProperty("references") Set<String> references); }
ExplicitField { public Predicate convertToPredicate() { Map<String, Long> valueTypes = new HashMap<>(); Map<String, Long> referenceTypes = new HashMap<>(); if (values != null) { for (String value : values) { valueTypes.put(value, 0L); } } if (references != null) { for (String reference : references) { referenceTypes.put(reference, 0L); } } Predicate convertedPredicate = new Predicate(uri, Direction.OUT); convertedPredicate.setIsExplicit(true); convertedPredicate.setIsList(isList); convertedPredicate.setValueTypes(valueTypes); convertedPredicate.setReferenceTypes(referenceTypes); return convertedPredicate; } @JsonCreator  ExplicitField(@JsonProperty("uri") String uri,
                       @JsonProperty("isList") boolean isList,
                       @JsonProperty("values") Set<String> values,
                       @JsonProperty("references") Set<String> references); Set<String> getValues(); void setValues(Set<String> values); Set<String> getReferences(); void setReferences(Set<String> references); String getUri(); Predicate convertToPredicate(); @JsonProperty("isList") boolean isList(); void setList(boolean list); ExplicitField mergeWith(ExplicitField explicitField); }
ExplicitField { public Predicate convertToPredicate() { Map<String, Long> valueTypes = new HashMap<>(); Map<String, Long> referenceTypes = new HashMap<>(); if (values != null) { for (String value : values) { valueTypes.put(value, 0L); } } if (references != null) { for (String reference : references) { referenceTypes.put(reference, 0L); } } Predicate convertedPredicate = new Predicate(uri, Direction.OUT); convertedPredicate.setIsExplicit(true); convertedPredicate.setIsList(isList); convertedPredicate.setValueTypes(valueTypes); convertedPredicate.setReferenceTypes(referenceTypes); return convertedPredicate; } @JsonCreator  ExplicitField(@JsonProperty("uri") String uri,
                       @JsonProperty("isList") boolean isList,
                       @JsonProperty("values") Set<String> values,
                       @JsonProperty("references") Set<String> references); Set<String> getValues(); void setValues(Set<String> values); Set<String> getReferences(); void setReferences(Set<String> references); String getUri(); Predicate convertToPredicate(); @JsonProperty("isList") boolean isList(); void setList(boolean list); ExplicitField mergeWith(ExplicitField explicitField);  }