All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudinary.transformation.Expression Maven / Gradle / Ivy

Go to download

Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline. Upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more. This Java library allows to easily integrate with Cloudinary in Java applications.

The newest version!
package com.cloudinary.transformation;

/**
 * Represents a transformation parameter expression.
 */
public class Expression extends BaseExpression {

    private boolean predefined = false;

    public Expression(){
        super();
    }

    public Expression(String name){
        super();
        expressions.add(name);
    }

    public static Expression variable(String name, Object value){
        Expression var = new Expression(name);
        var.expressions.add(value.toString());
        return var;
    }

    public static Expression faceCount() {
        return new Expression("fc");
    }

    @Override
    protected Expression newInstance() {
        return new Expression();
    }
    /*
    * @returns a new expression with the predefined variable "width"
     */
    public static Expression width() {
        return new Expression("width");
    }
    /*
    * @returns a new expression with the predefined variable "height"
     */
    public static Expression height() {
        return new Expression("height");
    }
    /*
    * @returns a new expression with the predefined variable "initialWidth"
     */
    public static Expression initialWidth() {
        return new Expression("initialWidth");
    }
    /*
    * @returns a new expression with the predefined variable "initialHeight"
     */
    public static Expression initialHeight() {
        return new Expression("initialHeight");
    }
    /*
    * @returns a new expression with the predefined variable "aspectRatio"
     */
    public static Expression aspectRatio() {
        return new Expression("aspectRatio");
    }
    /*
    * @returns a new expression with the predefined variable "initialAspectRatio"
     */
    public static Expression initialAspectRatio() {
        return new Expression("initialAspectRatio");
    }
    /*
    * @returns a new expression with the predefined variable "pageCount"
     */
    public static Expression pageCount() {
        return new Expression("pageCount");
    }
    /*
    * @returns a new expression with the predefined variable "currentPage"
     */
    public static Expression currentPage() {
        return new Expression("currentPage");
    }
    /*
    * @returns a new expression with the predefined variable "tags"
     */
    public static Expression tags() {
        return new Expression("tags");
    }
    /*
    * @returns a new expression with the predefined variable "pageX"
     */
    public static Expression pageX() {
        return new Expression("pageX");
    }
    /*
    * @returns a new expression with the predefined variable "pageY"
     */
    public static Expression pageY() {
        return new Expression("pageY");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy