
com.bigdata.blueprints.PartialElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bigdata-blueprints Show documentation
Show all versions of bigdata-blueprints Show documentation
Blazegraph support for Tinkerpop 2.5
The newest version!
/**
Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved.
Contact:
SYSTAP, LLC DBA Blazegraph
2501 Calvert ST NW #106
Washington, DC 20008
[email protected]
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.bigdata.blueprints;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.tinkerpop.blueprints.Element;
public class PartialElement implements Element {
private final String id;
private final Map properties =
new LinkedHashMap();
public PartialElement(final String id) {
this.id = id;
}
@Override
public Object getId() {
return id;
}
@Override
@SuppressWarnings("unchecked")
public Object getProperty(final String name) {
return properties.get(name);
}
@Override
public Set getPropertyKeys() {
return properties.keySet();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@Override
@SuppressWarnings("unchecked")
public Object removeProperty(final String key) {
return properties.remove(key);
}
@Override
public void setProperty(final String key, final Object value) {
/*
* Gracefully turn a single value property into a
* multi-valued property.
*/
if (properties.containsKey(key)) {
final Object o = properties.get(key);
if (o instanceof List) {
@SuppressWarnings("unchecked")
final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy