aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/model')
-rw-r--r--src/main/java/com/juick/model/ExternalToken.java37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/main/java/com/juick/model/ExternalToken.java b/src/main/java/com/juick/model/ExternalToken.java
index 65a07e55..12f5388c 100644
--- a/src/main/java/com/juick/model/ExternalToken.java
+++ b/src/main/java/com/juick/model/ExternalToken.java
@@ -17,48 +17,13 @@
package com.juick.model;
-import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by vitalyster on 22.11.2016.
*/
-public class ExternalToken {
- private final String name;
- private final String type;
- private final String token;
- private final String secret;
-
- @JsonCreator
- public ExternalToken(@JsonProperty("name") String name,
+public record ExternalToken(@JsonProperty("name") String name,
@JsonProperty("type") String type,
@JsonProperty("token") String token,
@JsonProperty("secret") String secret) {
- this.name = name;
- this.type = type;
- this.token = token;
- this.secret = secret;
- if (this.type == null) {
- throw new IllegalStateException("Token must have type");
- }
- if (this.token == null) {
- throw new IllegalStateException("Token must have value");
- }
- }
-
- public String getType() {
- return type;
- }
-
- public String getToken() {
- return token;
- }
-
- public String getName() {
- return name;
- }
-
- public String getSecret() {
- return secret;
- }
}