/** * Adds a property with an Integer value * @param propertyName The name of the property * @param intValue The integer value to add to the property * @return The entity the property has been added to */ @Override public SimpleEntity addProperty(String propertyName, int intValue) { addValueToProperty(propertyName, new IntegerValue(intValue)); return this; }
/** * Adds a property with an Integer value * @param propertyName The name of the property * @param isCollection True if this is a collection, False if not * @param intValue The integer value to add to the property * @return The entity the property has been added to */ @Override public SimpleEntity addProperty(String propertyName, boolean isCollection, int intValue) { addValueToProperty(propertyName, isCollection, new IntegerValue(intValue)); return this; }
/** * Sets a property with given name to the current value, overriding any current * value and property set for that given property name * @param propertyName THe name of the property * @param value The Integer value to add or override current values * @return The entity the property has been set on */ @Override public SimpleEntity setProperty(String propertyName, int value) { removeProperty(propertyName); addValueToProperty(propertyName, new IntegerValue(value)); return this; }
/** * Allows a bulk set operation of the properties. The properties map contains a key * value pair, the values can be of type {@link java.lang.Integer} , {@link java.lang.Long} * or {@link java.lang.String}. Any unknown types will be called by using the toString operation. * * @param newProperties The properties containing key value pairs * @return The entity the properties have been set on */ @Override public SimpleEntity setProperties(Map<String, Object> newProperties) { this.properties.clear(); for(Map.Entry<String, Object> entry : newProperties.entrySet()) { if(entry.getValue() instanceof Integer) { addValueToProperty(entry.getKey(), new IntegerValue((Integer) entry.getValue())); } else if(entry.getValue() instanceof Long) { addValueToProperty(entry.getKey(), new LongValue((Long) entry.getValue())); } else { addValueToProperty(entry.getKey(), new StringValue(entry.getValue().toString())); } } return this; }