![JAR search and dependency download from the Maven repository](/logo.png)
com.silanis.esl.sdk.PackageId Maven / Gradle / Ivy
package com.silanis.esl.sdk;
import java.io.Serializable;
/**
* This class uniquely identify a document package
*/
public class PackageId implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
PackageId() {
}
/**
* Constructor of the PackageId class
*
* @param id the ID of the package. It cannot be null or empty
*/
public PackageId( String id ) {
if ( id == null || id.trim().isEmpty() ) {
throw new IllegalArgumentException( ( "id parameter cannot be null or empty" ) );
}
this.id = id;
}
/**
*
Accessor method used to get the package ID
*
* @return the ID of the package
*/
public String getId() {
return id;
}
@Override
public String toString() {
return id;
}
@Override
public int hashCode() {
return id.hashCode();
}
@Override
public boolean equals( Object other ) {
if ( this == other ) {
return true;
}
if ( !( other instanceof PackageId ) ) {
return false;
}
PackageId packageId = (PackageId) other;
return packageId.id.equals( id );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy