public void remove(String key) { for (Map.Entry<String, Entry> e : new ArrayList<Map.Entry<String, Entry>>(entries.entrySet())) { if (e.getValue().getKey().equals(key)) { entries.remove(e.getKey()); } } }
public void remove(String key) { for (Map.Entry<String, Entry> e : new ArrayList<Map.Entry<String, Entry>>(entries.entrySet())) { if (e.getValue().getKey().equals(key)) { entries.remove(e.getKey()); } } }
public boolean containsKey(String key) { for (Map.Entry<String, Entry> e : entries.entrySet()) { if (e.getValue().getKey().equals(key)) { return true; } } return false; }
public void update(Property property) { if (property.getHiddenVisibilities() != null) { for (Visibility v : property.getHiddenVisibilities()) { addHiddenVisibility(v); } } setValue(property.getValue()); for (Metadata.Entry m : property.getMetadata().entrySet()) { if (m.getValue() == null) { removeMetadata(m.getKey(), m.getVisibility()); } else { addMetadata(m.getKey(), m.getValue(), m.getVisibility()); } } } }
public void update(Property property) { if (property.getHiddenVisibilities() != null) { for (Visibility v : property.getHiddenVisibilities()) { addHiddenVisibility(v); } } setValue(property.getValue()); for (Metadata.Entry m : property.getMetadata().entrySet()) { if (m.getValue() == null) { removeMetadata(m.getKey(), m.getVisibility()); } else { addMetadata(m.getKey(), m.getValue(), m.getVisibility()); } } } }
public void addPropertyMetadataToMutation(Mutation m, Property property) { Metadata metadata = property.getMetadata(); for (Metadata.Entry metadataItem : metadata.entrySet()) { Text columnQualifier = getPropertyMetadataColumnQualifier(property, metadataItem.getKey()); ColumnVisibility metadataVisibility = visibilityToAccumuloVisibility(metadataItem.getVisibility()); if (metadataItem.getValue() == null) { m.putDelete(AccumuloElement.CF_PROPERTY_METADATA, columnQualifier, metadataVisibility); } else { Value metadataValue = new Value(valueSerializer.objectToValue(metadataItem.getValue())); m.put(AccumuloElement.CF_PROPERTY_METADATA, columnQualifier, metadataVisibility, metadataValue); } } }
public void addPropertyRemoveToMutation(Mutation m, Property property) { checkNotNull(m, "mutation cannot be null"); checkNotNull(property, "property cannot be null"); Text columnQualifier = getPropertyColumnQualifier(property); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); m.putDelete(AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility); for (Metadata.Entry metadataEntry : property.getMetadata().entrySet()) { Text metadataEntryColumnQualifier = getPropertyMetadataColumnQualifier(property, metadataEntry.getKey()); ColumnVisibility metadataEntryVisibility = visibilityToAccumuloVisibility(metadataEntry.getVisibility()); m.putDelete(AccumuloElement.CF_PROPERTY_METADATA, metadataEntryColumnQualifier, metadataEntryVisibility); } }
private JSONObject metadataToJson(Metadata metadata) { JSONObject json = new JSONObject(); for (Metadata.Entry m : metadata.entrySet()) { json.put(m.getKey(), metadataItemToJson(m)); } return json; }
public void addPropertyRemoveMetadataToMutation(Mutation m, PropertyRemoveMutation propertyRemoveMutation) { if (propertyRemoveMutation instanceof PropertyPropertyRemoveMutation) { Property property = ((PropertyPropertyRemoveMutation) propertyRemoveMutation).getProperty(); Metadata metadata = property.getMetadata(); for (Metadata.Entry metadataItem : metadata.entrySet()) { Text columnQualifier = getPropertyMetadataColumnQualifier(property, metadataItem.getKey()); ColumnVisibility metadataVisibility = visibilityToAccumuloVisibility(metadataItem.getVisibility()); m.putDelete(AccumuloElement.CF_PROPERTY_METADATA, columnQualifier, metadataVisibility); } } }
public boolean containsKey(String key) { for (Map.Entry<String, Entry> e : entries.entrySet()) { if (e.getValue().getKey().equals(key)) { return true; } } return false; }
public Entry getEntry(String key) { Entry entry = null; for (Map.Entry<String, Entry> e : entries.entrySet()) { if (e.getValue().getKey().equals(key)) { if (entry != null) { throw new SecureGraphException("Multiple matching entries for key: " + key); } entry = e.getValue(); } } return entry; }
public static JSONObject propertyMetadataToJson(Metadata metadata) { JSONObject json = new JSONObject(); for (Metadata.Entry entry : metadata.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; } }
public Entry getEntry(String key) { Entry entry = null; for (Map.Entry<String, Entry> e : entries.entrySet()) { if (e.getValue().getKey().equals(key)) { if (entry != null) { throw new SecureGraphException("Multiple matching entries for key: " + key); } entry = e.getValue(); } } return entry; }