-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2107 from alphagov/bau_use_WrappedStringValue
BAU — Make some specific string types extend WrappedStringValue
- Loading branch information
Showing
4 changed files
with
10 additions
and
107 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
src/main/java/uk/gov/pay/connector/charge/model/CardHolderName.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 3 additions & 24 deletions
27
src/main/java/uk/gov/pay/connector/charge/model/ServicePaymentReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,15 @@ | ||
package uk.gov.pay.connector.charge.model; | ||
|
||
import java.util.Objects; | ||
import uk.gov.pay.commons.model.WrappedStringValue; | ||
|
||
public class ServicePaymentReference { | ||
|
||
private final String servicePaymentReference; | ||
public class ServicePaymentReference extends WrappedStringValue { | ||
|
||
private ServicePaymentReference(String servicePaymentReference) { | ||
this.servicePaymentReference = Objects.requireNonNull(servicePaymentReference); | ||
super(servicePaymentReference); | ||
} | ||
|
||
public static ServicePaymentReference of(String servicePaymentReference) { | ||
return new ServicePaymentReference(servicePaymentReference); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other != null && other.getClass() == ServicePaymentReference.class) { | ||
ServicePaymentReference that = (ServicePaymentReference) other; | ||
return this.servicePaymentReference.equals(that.servicePaymentReference); | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return servicePaymentReference.hashCode(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return servicePaymentReference; | ||
} | ||
|
||
} |