NextGenDynamicMediaImageDeliveryParams.java

/*
 * #%L
 * wcm.io
 * %%
 * Copyright (C) 2024 wcm.io
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package io.wcm.handler.mediasource.ngdm.impl;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import io.wcm.handler.media.Dimension;

/**
 * Parameters for rendering a rendition.
 */
public class NextGenDynamicMediaImageDeliveryParams {

  private Long width;
  private String widthPlaceholder;
  private Long height;
  private String heightPlaceholder;
  private Dimension ratio;
  private Integer rotation;
  private Integer quality;

  /**
   * @return Width
   */
  public @Nullable Long getWidth() {
    return this.width;
  }

  /**
   * @param value Width
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams width(@Nullable Long value) {
    this.width = value;
    return this;
  }

  /**
   * @return Width placeholder
   */
  public @Nullable String getWidthPlaceholder() {
    return this.widthPlaceholder;
  }

  /**
   * @param value Width placeholder
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams widthPlaceholder(@Nullable String value) {
    this.widthPlaceholder = value;
    return this;
  }

  /**
   * @return Height
   */
  public @Nullable Long getHeight() {
    return this.height;
  }

  /**
   * @param value Height
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams height(@Nullable Long value) {
    this.height = value;
    return this;
  }

  /**
   * @return Height placeholder
   */
  public @Nullable String getHeightPlaceholder() {
    return this.heightPlaceholder;
  }

  /**
   * @param value Height placeholder
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams heightPlaceholder(@Nullable String value) {
    this.heightPlaceholder = value;
    return this;
  }

  /**
   * @return Dimension with aspect ratio for smart cropping
   */
  public @Nullable Dimension getRatio() {
    return this.ratio;
  }

  /**
   * @param value Dimension with aspect ratio for smart cropping
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams ratio(@Nullable Dimension value) {
    this.ratio = value;
    return this;
  }

  /**
   * @return Rotation
   */
  public @Nullable Integer getRotation() {
    return this.rotation;
  }

  /**
   * @param value Rotation
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams rotation(@Nullable Integer value) {
    this.rotation = value;
    return this;
  }

  /**
   * @return Quality
   */
  public @Nullable Integer getQuality() {
    return this.quality;
  }

  /**
   * @param value Quality
   * @return this
   */
  public @NotNull NextGenDynamicMediaImageDeliveryParams quality(@Nullable Integer value) {
    this.quality = value;
    return this;
  }

}