
net.dona.doip.client.DigitalObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-sdk Show documentation
Show all versions of doip-sdk Show documentation
DOIP Software Development Kit that implements DOIP v2 Specification.
package net.dona.doip.client;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.List;
/**
* A Java representation of a Digital Object.
*/
public class DigitalObject {
/**
* The identifier of the object.
*/
public String id;
/**
* The type of the object.
*/
public String type;
/**
* The attributes of the object.
*/
public JsonObject attributes;
/**
* The elements of the object.
*/
public List elements;
/**
* A convenience method that sets an attribute on the object.
*
* @param name the name of the attribute
* @param att the value to set
*/
public synchronized void setAttribute(String name, JsonElement att) {
if (attributes == null) {
attributes = new JsonObject();
}
attributes.add(name, att);
}
/**
* A convenience method that sets an attribute on the object.
*
* @param name the name of the attribute
* @param att the value to set as a String
*/
public synchronized void setAttribute(String name, String att) {
if (attributes == null) {
attributes = new JsonObject();
}
attributes.addProperty(name, att);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy