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

com.cedarsoft.utils.image.ImageFormat Maven / Gradle / Ivy

package com.cedarsoft.utils.image;

import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

/**
 * The format of the scanned image
 */
public enum ImageFormat {
  JPEG( "jpg" );

  @NotNull
  @NonNls
  private final String suffix;

  ImageFormat( String suffix ) {
    this.suffix = suffix;
  }

  @NotNull
  @NonNls
  public String getSuffix() {
    return suffix;
  }

  @NotNull
  public static ImageFormat find( String suffix ) {
    for ( ImageFormat format : values() ) {
      if ( format.getSuffix().equals( suffix ) ) {
        return format;
      }
    }
    throw new IllegalArgumentException( "No ImageFormat found for suffix " + suffix );
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy