public String measurementUnit(String runtimeName, Integer streamIndex) { return sepaElement .getInputStreams() .get(streamIndex) .getEventSchema() .getEventProperties() .stream() .filter(ep -> ep.getRuntimeName().equals(runtimeName)) .map(ep -> (EventPropertyPrimitive) ep) .findFirst() .get() .getMeasurementUnit() .toString(); }
private boolean isAnyProperty(EventProperty eventProperty) { return eventProperty instanceof EventPropertyPrimitive && eventProperty.getDomainProperties() == null && ((EventPropertyPrimitive) eventProperty).getMeasurementUnit() == null && ((EventPropertyPrimitive) eventProperty).getRuntimeType() == null; }
private boolean isAnyProperty(EventProperty eventProperty) { return eventProperty instanceof EventPropertyPrimitive && eventProperty.getDomainProperties() == null && ((EventPropertyPrimitive) eventProperty).getMeasurementUnit() == null && ((EventPropertyPrimitive) eventProperty).getRuntimeType() == null; }
@Override public boolean match(EventPropertyPrimitive offer, EventPropertyPrimitive requirement, List<MatchingResultMessage> errorLog) { boolean matchesUnit = unitMatch(offer.getMeasurementUnit(), requirement.getMeasurementUnit(), errorLog); boolean matchesDatatype = datatypeMatch(offer.getRuntimeType(), requirement.getRuntimeType(), errorLog); boolean matchesDomainProperty = domainPropertyMatch(offer.getDomainProperties(), requirement.getDomainProperties (), errorLog); return MatchingUtils.nullCheck(offer, requirement) || (matchesUnit && matchesDatatype && matchesDomainProperty); }
@Override public boolean match(EventPropertyPrimitive offer, EventPropertyPrimitive requirement, List<MatchingResultMessage> errorLog) { boolean matchesUnit = unitMatch(offer.getMeasurementUnit(), requirement.getMeasurementUnit(), errorLog); boolean matchesDatatype = datatypeMatch(offer.getRuntimeType(), requirement.getRuntimeType(), errorLog); boolean matchesDomainProperty = domainPropertyMatch(offer.getDomainProperties(), requirement.getDomainProperties (), errorLog); return MatchingUtils.nullCheck(offer, requirement) || (matchesUnit && matchesDatatype && matchesDomainProperty); }
public EventPropertyPrimitive(EventPropertyPrimitive other) { super(other); this.runtimeType = other.getRuntimeType(); this.measurementUnit = other.getMeasurementUnit(); if (other.getValueSpecification() != null) { this.valueSpecification = new Cloner().valueSpecification(other .getValueSpecification()); } }