Skip to content

Commit ccacc6a

Browse files
committed
Add Transformation::toString()
1 parent 7cdfef3 commit ccacc6a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cloudinary-core/src/main/java/com/cloudinary/Transformation.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,23 @@ public Transformation param(String key, Object value) {
382382
return this;
383383
}
384384

385+
/**
386+
* Serialize this transformation object as a string
387+
*
388+
* {@code
389+
* Transformation().width(100).height(101).generate(); // produces "h_101,w_100"
390+
* }
391+
* @return a String representation of the transformation
392+
*/
385393
public String generate() {
386394
return generate(transformations);
387395
}
388396

397+
@Override
398+
public String toString() {
399+
return generate();
400+
}
401+
389402
public String generate(Iterable<Map> optionsList) {
390403
List<String> components = new ArrayList<String>();
391404
for (Map options : optionsList) {

0 commit comments

Comments
 (0)