Skip to content

Commit

Permalink
feat: attributes can't be null
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarlic committed Aug 20, 2024
1 parent fc951d1 commit 933b14e
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/main/java/cl/transbank/model/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,36 @@
@AllArgsConstructor
public abstract class Options implements Cloneable {

@Setter
@Getter
private String commerceCode;

@Setter
@Getter
private String apiKey;

@Setter
@Getter
private IntegrationType integrationType;

public void setCommerceCode(String commerceCode){
if (commerceCode == null){
throw new IllegalArgumentException("CommerceCode can't be null.");
}
this.commerceCode = commerceCode;
}

public void setApiKey(String apiKey){
if (apiKey == null){
throw new IllegalArgumentException("ApiKey can't be null.");
}
this.apiKey = apiKey;
}

public void setIntegrationType(IntegrationType integrationType){
if (integrationType == null){
throw new IllegalArgumentException("IntegrationType can't be null.");
}
this.integrationType = integrationType;
}

/**
* Builds the options for a transaction.
* @param options The options to set.
Expand Down

0 comments on commit 933b14e

Please sign in to comment.