Fix dspace-api module per new code style

This commit is contained in:
Tim Donohue
2018-02-14 10:53:46 -06:00
parent 8ffc97f7f9
commit 8a48f782ea
1051 changed files with 53347 additions and 63373 deletions

View File

@@ -7,13 +7,20 @@
*/
package org.dspace.content;
import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.dspace.core.Context;
import org.dspace.core.ReloadableEntity;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
/**
* Class representing a schema in DSpace.
* <p>
@@ -30,16 +37,18 @@ import javax.persistence.*;
@Entity
@Cacheable
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Table(name="metadataschemaregistry")
public class MetadataSchema implements ReloadableEntity<Integer>
{
/** Short Name of built-in Dublin Core schema. */
@Table(name = "metadataschemaregistry")
public class MetadataSchema implements ReloadableEntity<Integer> {
/**
* Short Name of built-in Dublin Core schema.
*/
public static final String DC_SCHEMA = "dc";
@Id
@Column(name="metadata_schema_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="metadataschemaregistry_seq")
@SequenceGenerator(name="metadataschemaregistry_seq", sequenceName="metadataschemaregistry_seq", allocationSize = 1)
@Column(name = "metadata_schema_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "metadataschemaregistry_seq")
@SequenceGenerator(name = "metadataschemaregistry_seq", sequenceName = "metadataschemaregistry_seq",
allocationSize = 1)
private Integer id;
@Column(name = "namespace", unique = true, length = 256)
@@ -51,40 +60,32 @@ public class MetadataSchema implements ReloadableEntity<Integer>
/**
* Protected constructor, create object using:
* {@link org.dspace.content.service.MetadataSchemaService#create(Context, String, String)}
*
*/
protected MetadataSchema()
{
protected MetadataSchema() {
}
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
if (getClass() != objClass)
{
if (getClass() != objClass) {
return false;
}
final MetadataSchema other = (MetadataSchema) obj;
if (this.id != other.id)
{
if (this.id != other.id) {
return false;
}
if ((this.namespace == null) ? (other.namespace != null) : !this.namespace.equals(other.namespace))
{
if ((this.namespace == null) ? (other.namespace != null) : !this.namespace.equals(other.namespace)) {
return false;
}
return true;
}
@Override
public int hashCode()
{
public int hashCode() {
int hash = 5;
hash = 67 * hash + this.id;
hash = 67 * hash + (this.namespace != null ? this.namespace.hashCode() : 0);
@@ -96,18 +97,16 @@ public class MetadataSchema implements ReloadableEntity<Integer>
*
* @return namespace String
*/
public String getNamespace()
{
public String getNamespace() {
return namespace;
}
/**
* Set the schema namespace.
*
* @param namespace XML namespace URI
* @param namespace XML namespace URI
*/
public void setNamespace(String namespace)
{
public void setNamespace(String namespace) {
this.namespace = namespace;
}
@@ -116,18 +115,16 @@ public class MetadataSchema implements ReloadableEntity<Integer>
*
* @return name String
*/
public String getName()
{
public String getName() {
return name;
}
/**
* Set the schema name.
*
* @param name short name of schema
* @param name short name of schema
*/
public void setName(String name)
{
public void setName(String name) {
this.name = name;
}
@@ -136,8 +133,7 @@ public class MetadataSchema implements ReloadableEntity<Integer>
*
* @return schema record key
*/
public Integer getID()
{
public Integer getID() {
return id;
}
}