org.duracloud.domain.Space Maven / Gradle / Ivy
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://duracloud.org/license/
*/
package org.duracloud.domain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* A Space - the container in which content is stored.
*
* @author Bill Branan
*/
public class Space {
private String id;
private Map properties = new HashMap();
private List contentIds = new ArrayList();
/**
* Getter for the field id
.
*/
public String getId() {
return id;
}
/**
* Setter for the field id
.
*/
public void setId(String id) {
this.id = id;
}
/**
* Getter for the field properties
.
*/
public Map getProperties() {
return properties;
}
/**
* Setter for the field properties
.
*/
public void setProperties(Map properties) {
this.properties = properties;
}
/**
* Adds an item to the space properties map
*
* @param name properties key
* @param value properties value
*/
public void addProperties(String name, String value) {
properties.put(name, value);
}
/**
* Getter for the field contentIds
.
*/
public List getContentIds() {
return contentIds;
}
/**
* Setter for the field contentIds
.
*/
public void setContentIds(List contentIds) {
this.contentIds = contentIds;
}
/**
* addContentId
*/
public void addContentId(String contentId) {
contentIds.add(contentId);
}
/**
* Compares one space to another
*
* @return true if the spaces properties and contents are equal
*/
public boolean equals(Space space) {
boolean equals = false;
if (getId().equals(space.getId()) &&
getProperties().equals(space.getProperties()) &&
getContentIds().equals(space.getContentIds())) {
equals = true;
}
return equals;
}
}