eu.peppol.identifier.TransactionIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oxalis-api Show documentation
Show all versions of oxalis-api Show documentation
Holds the stuff required by external components, which may be hooked into Oxalis.
Classes and resources in this module should be made available to oxalis-inbound
by placing it into a shared library in the web container.
/* Created by steinar on 20.05.12 at 13:00 */
package eu.peppol.identifier;
/**
* Type safe value object holding a PEPPOL transaction id
*
* @author Steinar Overbeck Cook [email protected]
*/
public class TransactionIdentifier {
private final String transactionId;
public TransactionIdentifier(String transactionId) {
this.transactionId = transactionId;
}
public static TransactionIdentifier valueFor(String transactionId) {
return new TransactionIdentifier(transactionId);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TransactionIdentifier that = (TransactionIdentifier) o;
if (!transactionId.equals(that.transactionId)) return false;
return true;
}
@Override
public int hashCode() {
return transactionId.hashCode();
}
@Override
public String toString() {
return transactionId;
}
}