Class ProductUtil

java.lang.Object
de.dlr.proseo.ingestor.rest.model.ProductUtil

public class ProductUtil extends Object
Utility methods for products, e. g. for conversion between prosEO model and REST model
Author:
Dr. Thomas Bassler
  • Constructor Details

    • ProductUtil

      public ProductUtil()
  • Method Details

    • toRestProduct

      public static RestProduct toRestProduct(Product modelProduct)
      Convert a prosEO model product into a REST product
      Parameters:
      modelProduct - the prosEO model product
      Returns:
      an equivalent REST product or null, if no model product was given
    • toModelProduct

      public static Product toModelProduct(RestProduct restProduct) throws IllegalArgumentException
      Convert a REST product into a prosEO model product (scalar and embedded attributes only, no object references); does not create or update the download history.
      Parameters:
      restProduct - the REST product
      Returns:
      a (roughly) equivalent model product or null, if no REST product was given
      Throws:
      IllegalArgumentException - if the REST product violates syntax rules for date, enum or numeric values