Skip to content

Commit

Permalink
chore: add to string implementations to relevant storage responses (#366
Browse files Browse the repository at this point in the history
)

GetResponse and ListStoresResponse should have meaningful to
string implementations. This PR adds them.
  • Loading branch information
malandis authored Jun 21, 2024
1 parent 1c084fa commit d5896ff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public Optional<StorageValue> value() {
public Optional<Success> success() {
return Optional.of(this);
}

@Override
public String toString() {
return super.toString() + ": value: " + value;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public Success(List<StoreInfo> stores) {
public List<StoreInfo> getStores() {
return stores;
}

@Override
public String toString() {
return super.toString() + ": stores: " + stores;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package momento.sdk.responses.storage;

import java.util.Optional;
import momento.sdk.internal.StringHelpers;

/**
* A value stored in the storage.
Expand Down Expand Up @@ -99,4 +100,13 @@ public Optional<Double> getDouble() {
}
return Optional.of((double) value);
}

@Override
public String toString() {
return super.toString()
+ ": value: "
+ StringHelpers.truncate(value.toString())
+ ", itemType:"
+ itemType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ public StoreInfo(String name) {
public String getName() {
return name;
}

@Override
public String toString() {
return super.toString() + ": name: " + name;
}
}

0 comments on commit d5896ff

Please sign in to comment.