/* Copyright (c) 2001 - 2008 TOPP - www.openplans.org. All rights reserved.
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.catalog.impl;
import java.io.Serializable;
import org.geoserver.catalog.CatalogVisitor;
import org.geoserver.catalog.MetadataMap;
import org.geoserver.catalog.WorkspaceInfo;
public class WorkspaceInfoImpl implements WorkspaceInfo, Serializable {
protected String id;
protected String name;
protected boolean _default;
protected MetadataMap metadata = new MetadataMap();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public boolean isDefault() {
return _default;
}
public void setDefault(boolean _default) {
this._default = _default;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public MetadataMap getMetadata() {
return metadata;
}
public void setMetadata(MetadataMap metadata) {
this.metadata = metadata;
}
public void accept(CatalogVisitor visitor) {
visitor.visit(this);
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof WorkspaceInfo))
return false;
final WorkspaceInfo other = (WorkspaceInfo) obj;
if (id == null) {
if (other.getId() != null)
return false;
} else if (!id.equals(other.getId()))
return false;
if (name == null) {
if (other.getName() != null)
return false;
} else if (!name.equals(other.getName()))
return false;
return true;
}
@Override
public String toString() {
return new StringBuilder(getClass().getSimpleName()).append('[').append(name).append(']')
.toString();
}
}