-
Notifications
You must be signed in to change notification settings - Fork 18
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 #329 from getyoti/RELEASE-3.5.0
Release 3.5.0
- Loading branch information
Showing
23 changed files
with
784 additions
and
322 deletions.
There are no files selected for viewing
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
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
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
88 changes: 88 additions & 0 deletions
88
yoti-sdk-api/src/main/java/com/yoti/api/client/spi/remote/call/ErrorDetails.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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package com.yoti.api.client.spi.remote.call; | ||
|
||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
|
||
@JsonDeserialize(builder = ErrorDetails.Builder.class) | ||
public final class ErrorDetails { | ||
|
||
private final String code; | ||
private final String description; | ||
|
||
private ErrorDetails(Builder builder) { | ||
this.code = builder.code; | ||
this.description = builder.description; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
ErrorDetails that = (ErrorDetails) o; | ||
return Objects.equals(code, that.code) && Objects.equals(description, that.description); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(code, description); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("Error[code='%s', description='%s']", code, description); | ||
} | ||
|
||
public static final class Builder { | ||
|
||
private String code; | ||
private String description; | ||
|
||
private Builder() { } | ||
|
||
@JsonProperty(Property.ERROR_CODE) | ||
public Builder code(String code) { | ||
this.code = code; | ||
return this; | ||
} | ||
|
||
@JsonProperty(Property.DESCRIPTION) | ||
public Builder description(String description) { | ||
this.description = description; | ||
return this; | ||
} | ||
|
||
public ErrorDetails build() { | ||
return new ErrorDetails(this); | ||
} | ||
|
||
} | ||
|
||
private static final class Property { | ||
|
||
private static final String ERROR_CODE = "error_code"; | ||
private static final String DESCRIPTION = "description"; | ||
|
||
private Property() { } | ||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.