case org.modeshape.jcr.api.PropertyType.SIMPLE_REFERENCE:
return this.getString().equals(that.getString());
case PropertyType.URI:
return this.getString().equals(that.getString());
default:
throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
}
} catch (RepositoryException e) {
return false;
}
// will not get here
}
if (obj instanceof Value) {
Value that = (Value)obj;
if (this.type != that.getType()) return false;
try {
switch (this.type) {
case PropertyType.STRING:
return this.getString().equals(that.getString());
case PropertyType.BINARY:
return IoUtil.isSame(this.getStream(), that.getBinary().getStream());
case PropertyType.BOOLEAN:
return this.getBoolean() == that.getBoolean();
case PropertyType.DOUBLE:
return this.getDouble() == that.getDouble();
case PropertyType.LONG:
return this.getLong() == that.getLong();
case PropertyType.DECIMAL:
return this.getDecimal().equals(that.getDecimal());
case PropertyType.DATE:
return this.getDate().equals(that.getDate());
case PropertyType.PATH:
return this.getString().equals(that.getString());
case PropertyType.NAME:
return this.getString().equals(that.getString());
case PropertyType.REFERENCE:
case PropertyType.WEAKREFERENCE:
case org.modeshape.jcr.api.PropertyType.SIMPLE_REFERENCE:
return this.getString().equals(that.getString());
case PropertyType.URI:
return this.getString().equals(that.getString());
default:
throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
}
} catch (IOException e) {
return false;
} catch (RepositoryException e) {
return false;