-
- @Override
- public Modifier setDescription(String description) {
- this.description = fromNullable(description);
- return this;
- }
-
- @Override
- public Image update() throws IllegalStateException {
- checkState(!key.isPresent() || (DefaultImage.this.key == null), "key can not be changed");
-
- if (key.isPresent()) {
- DefaultImage.this.key = key.get();
- }
- if (title.isPresent()) {
- DefaultImage.this.title = title.get();
- }
- if (description.isPresent()) {
- DefaultImage.this.description = description.get();
- }
-
- return DefaultImage.this;
- }
- };
- }
-
- @Override
- public String getFingerprint() {
- Hasher hash = Hashing.sha256().newHasher();
- hash.putString("Image(");
- hash.putString("ID(").putString(id).putString(")");
- hash.putString("Title(").putString(title).putString(")");
- hash.putString("Description(").putString(description).putString(")");
- hash.putString(")");
- return hash.hash().toString();
- }
-
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- @Override
- public boolean equals(Object object) {
- if (!(object instanceof DefaultImage)) {
- return false;