Skip to content

Instantly share code, notes, and snippets.

@dev-aritra
Created November 16, 2020 11:01
Show Gist options
  • Save dev-aritra/2ab1468bb792772a567faa4c42f4b51d to your computer and use it in GitHub Desktop.
Save dev-aritra/2ab1468bb792772a567faa4c42f4b51d to your computer and use it in GitHub Desktop.
public class Store {
private String id;
private final String name;
private final Location location;
public Store(String name, Location location) {
this.name = name;
this.location = location;
}
public Store(String id, String name, Location location) {
this.id = id;
this.name = name;
this.location = location;
}
public boolean isValid() {
return StringUtils.hasText(name) && location.isValid();
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public Location getLocation() {
return location;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment