@Test public void ifElse() throws Exception { String chained = "[{if: \"w_lt_200\",crop: \"fill\",height: 120,width: 80},\n" + " {if: \"else\",crop: \"fill\",height: 90, width: 100}]"; List transformations = ObjectUtils.toList(new JSONArray(chained)); Transformation transformation = new Transformation(transformations); assertEquals("should support if_else with transformation parameters", "if_w_lt_200,c_fill,h_120,w_80/if_else,c_fill,h_90,w_100", transformation.toString()); chained = "[{if: \"w_lt_200\"},\n" + " {crop: \"fill\",height: 120,width: 80},\n" + " {if: \"else\"},\n" + " {crop: \"fill\",height: 90,width: 100}]"; transformations = ObjectUtils.toList(new JSONArray(chained)); transformation = new Transformation(transformations); assertEquals("if_else should be without any transformation parameters", "if_w_lt_200/c_fill,h_120,w_80/if_else/c_fill,h_90,w_100", transformation.toString()); }
public T ifElse() { chain(); return param("if", "else"); }
Transformation implements Serializable { public T ifElse() { chain(); return param("if", "else"); } }
Transformation implements Serializable { public T ifElse() { chain(); return param("if", "else"); } Transformation(Transformation transformation);  Transformation(List<Map> transformations);  Transformation(); }
Transformation implements Serializable { public T ifElse() { chain(); return param("if", "else"); } Transformation(Transformation transformation);  Transformation(List<Map> transformations);  Transformation(); T width(Object value); T height(Object value); T named(String... value); T crop(String value); T background(String value); T color(String value); T effect(String value); T effect(String effect, Object param); T angle(int value); T angle(String... value); T border(String value); T border(int width, String color); T x(Object value); T y(Object value); T radius(Object value); T radius(Object topLeftBottomRight, Object topRightBottomLeft); T radius(Object topLeft, Object topRightBottomLeft, Object bottomRight); T radius(Object topLeft, Object topRight, Object bottomRight, Object bottomLeft); T radius(Object[] cornerRadiuses); T quality(Object value); T defaultImage(String value); T gravity(String value); T keyframeInterval(float value); T keyframeInterval(String value); T colorSpace(String value); T prefix(String value); T overlay(String value); T overlay(AbstractLayer<?> value); T underlay(String value); T underlay(AbstractLayer<?> value); T fetchFormat(String value); T density(Object value); T page(Object value); T delay(Object value); T opacity(Object value); T rawTransformation(String value); T flags(String... value); T dpr(float value); T dpr(int value); T dpr(String value); T duration(String value); T duration(float value); T duration(double value); T durationPercent(float value); T durationPercent(double value); T startOffset(String value); T startOffset(float value); T startOffset(double value); T startOffsetPercent(float value); T startOffsetPercent(double value); T endOffset(String value); T endOffset(float value); T endOffset(double value); T endOffsetPercent(float value); T endOffsetPercent(double value); T offset(String value); T offset(String[] value); T offset(float[] value); T offset(double[] value); T offset(Number[] value); T videoCodec(String value); T videoCodec(Map<String, String> value); T audioCodec(String value); T audioFrequency(String value); T audioFrequency(int value); T bitRate(String value); T bitRate(int value); T videoSampling(String value); T videoSamplingFrames(int value); T videoSamplingSeconds(Number value); T videoSamplingSeconds(int value); T videoSamplingSeconds(float value); T videoSamplingSeconds(double value); T zoom(String value); T zoom(float value); T zoom(double value); T aspectRatio(double value); T aspectRatio(String value); T aspectRatio(int nom, int denom); T responsiveWidth(boolean value); Condition ifCondition(); T ifCondition(String condition); T ifCondition(Expression expression); T ifCondition(Condition condition); T ifElse(); T endIf(); T fps(String value); T fps(double value); T fps(int value); T fps(Object rangeStart, Object rangeEnd); T streamingProfile(String value); boolean isResponsive(); boolean isHiDPI(); T params(Map transformation); T chain(); T chainWith(Transformation transformation); T param(String key, Object value); String generate(); @Override String toString(); String generate(Iterable<Map> optionsList); String generate(Map options); String getHtmlWidth(); String getHtmlHeight(); static void setResponsiveWidthTransformation(Map transformation); static void setDefaultIsResponsive(boolean isResponsive); static void setDefaultDPR(Object dpr); T variable(String name, Object value); T variables(Expression... variables); T customFunction(CustomFunction action); T customPreFunction(CustomFunction action); }
Transformation implements Serializable { public T ifElse() { chain(); return param("if", "else"); } Transformation(Transformation transformation);  Transformation(List<Map> transformations);  Transformation(); T width(Object value); T height(Object value); T named(String... value); T crop(String value); T background(String value); T color(String value); T effect(String value); T effect(String effect, Object param); T angle(int value); T angle(String... value); T border(String value); T border(int width, String color); T x(Object value); T y(Object value); T radius(Object value); T radius(Object topLeftBottomRight, Object topRightBottomLeft); T radius(Object topLeft, Object topRightBottomLeft, Object bottomRight); T radius(Object topLeft, Object topRight, Object bottomRight, Object bottomLeft); T radius(Object[] cornerRadiuses); T quality(Object value); T defaultImage(String value); T gravity(String value); T keyframeInterval(float value); T keyframeInterval(String value); T colorSpace(String value); T prefix(String value); T overlay(String value); T overlay(AbstractLayer<?> value); T underlay(String value); T underlay(AbstractLayer<?> value); T fetchFormat(String value); T density(Object value); T page(Object value); T delay(Object value); T opacity(Object value); T rawTransformation(String value); T flags(String... value); T dpr(float value); T dpr(int value); T dpr(String value); T duration(String value); T duration(float value); T duration(double value); T durationPercent(float value); T durationPercent(double value); T startOffset(String value); T startOffset(float value); T startOffset(double value); T startOffsetPercent(float value); T startOffsetPercent(double value); T endOffset(String value); T endOffset(float value); T endOffset(double value); T endOffsetPercent(float value); T endOffsetPercent(double value); T offset(String value); T offset(String[] value); T offset(float[] value); T offset(double[] value); T offset(Number[] value); T videoCodec(String value); T videoCodec(Map<String, String> value); T audioCodec(String value); T audioFrequency(String value); T audioFrequency(int value); T bitRate(String value); T bitRate(int value); T videoSampling(String value); T videoSamplingFrames(int value); T videoSamplingSeconds(Number value); T videoSamplingSeconds(int value); T videoSamplingSeconds(float value); T videoSamplingSeconds(double value); T zoom(String value); T zoom(float value); T zoom(double value); T aspectRatio(double value); T aspectRatio(String value); T aspectRatio(int nom, int denom); T responsiveWidth(boolean value); Condition ifCondition(); T ifCondition(String condition); T ifCondition(Expression expression); T ifCondition(Condition condition); T ifElse(); T endIf(); T fps(String value); T fps(double value); T fps(int value); T fps(Object rangeStart, Object rangeEnd); T streamingProfile(String value); boolean isResponsive(); boolean isHiDPI(); T params(Map transformation); T chain(); T chainWith(Transformation transformation); T param(String key, Object value); String generate(); @Override String toString(); String generate(Iterable<Map> optionsList); String generate(Map options); String getHtmlWidth(); String getHtmlHeight(); static void setResponsiveWidthTransformation(Map transformation); static void setDefaultIsResponsive(boolean isResponsive); static void setDefaultDPR(Object dpr); T variable(String name, Object value); T variables(Expression... variables); T customFunction(CustomFunction action); T customPreFunction(CustomFunction action); static final String VAR_NAME_RE; }