@Override public Set<String> keySet() { return properties.keySet(); }
/** * Constructs a by wrapping the provided {@link Properties} * and using the {@link uk.gov.gchq.gaffer.data.element.ElementValueLoader} to lazily load the property values when requested. * * @param properties the properties to wrap. * @param valueLoader the element value loader to use to lazily load the property values */ public LazyProperties(final Properties properties, final ElementValueLoader valueLoader) { this.valueLoader = valueLoader; this.properties = properties; loadedProperties = new HashSet<>(properties.keySet()); }
@Override public Set<String> keySet() { return properties.keySet(); }
/** * Constructs a by wrapping the provided {@link Properties} * and using the {@link uk.gov.gchq.gaffer.data.element.ElementValueLoader} to lazily load the property values when requested. * * @param properties the properties to wrap. * @param valueLoader the element value loader to use to lazily load the property values */ public LazyProperties(final Properties properties, final ElementValueLoader valueLoader) { this.valueLoader = valueLoader; this.properties = properties; loadedProperties = new HashSet<>(properties.keySet()); }
/** * Clone an {@link Element}, based on a target {@link Schema}. * * @param element the element to clone * @param schema the schema * @return the cloned element */ public Element cloneElement(final Element element, final Schema schema) { try { final Element clone = element.emptyClone(); final SchemaElementDefinition sed = schema.getElement(clone.getGroup()); for (final String propertyName : element.getProperties().keySet()) { final Object property = element.getProperty(propertyName); if (null == sed.getPropertyTypeDef(propertyName) || null == sed.getPropertyTypeDef(propertyName).getSerialiser()) { // This can happen if transient properties are derived - they will not have serialisers. LOGGER.warn("Can't find Serialisation for {}, returning uncloned property", propertyName); clone.putProperty(propertyName, property); } else if (null != property) { final Serialiser serialiser = sed.getPropertyTypeDef(propertyName).getSerialiser(); clone.putProperty(propertyName, serialiser.deserialise(serialiser.serialise(property))); } else { clone.putProperty(propertyName, null); } } return clone; } catch (final SerialisationException e) { throw new RuntimeException("SerialisationException converting elements", e); } } }