/** * {@inheritDoc} */ @Override public boolean equals( Object obj ) { if (this == obj) return true; if (obj instanceof Property) { Property that = (Property)obj; if (!this.getName().equals(that.getName())) return false; if (this.size() != that.size()) return false; Iterator<?> thisIter = iterator(); Iterator<?> thatIter = that.iterator(); while (thisIter.hasNext()) { // && thatIter.hasNext() Object thisValue = thisIter.next(); Object thatValue = thatIter.next(); if (ValueComparators.OBJECT_COMPARATOR.compare(thisValue, thatValue) != 0) return false; } return true; } return false; }
/** * {@inheritDoc} */ public int compareTo( Property that ) { if (this == that) return 0; int diff = this.getName().compareTo(that.getName()); if (diff != 0) return diff; diff = this.size() - that.size(); if (diff != 0) return diff; Iterator<?> thisIter = iterator(); Iterator<?> thatIter = that.iterator(); while (thisIter.hasNext()) { // && thatIter.hasNext() Object thisValue = thisIter.next(); Object thatValue = thatIter.next(); diff = ValueComparators.OBJECT_COMPARATOR.compare(thisValue, thatValue); if (diff != 0) return diff; } return 0; }
Property desired ) { if (desired.size() == 0) {
private void verifyProperty( StreamSequencerContext context, String name, Object... values ) { Property prop = context.getInputProperty(context.getValueFactories().getNameFactory().create(name)); assertThat(prop, notNullValue()); assertThat(prop.getName(), is(context.getValueFactories().getNameFactory().create(name))); assertThat(prop.isEmpty(), is(false)); assertThat(prop.size(), is(values.length)); assertThat(prop.isMultiple(), is(values.length > 1)); assertThat(prop.isSingle(), is(values.length == 1)); Iterator<?> iter = prop.getValues(); for (Object val : values) { assertThat(iter.hasNext(), is(true)); assertThat(iter.next(), is(val)); } }
uuid = getExecutionContext().getValueFactories().getUuidFactory().create(property.getValues().next()); if (property.size() > 0 && !property.getName().equals(ModeShapeLexicon.UUID)) { propsToStore.add(property);
uuid = getExecutionContext().getValueFactories().getUuidFactory().create(property.getValues().next()); } else { if (property.size() > 0) propsToStore.add(property);
if (property.size() > 0) propsToStore.put(property.getName(), property);