All Implemented Interfaces:
Sendable, Serializable

public class Brand extends DatalakeStorageItem implements Sendable, Serializable
Brand model.
Author:
Maxime ESCOURBIAC.
See Also:
  • Constructor Details

    • Brand

      public Brand()
      Default constructor.
    • Brand

      public Brand(String name)
      Brand constructor.
      Parameters:
      name - Brand name.
    • Brand

      public Brand(String name, int serviceLevel, Date lastScanDate)
      Brand constructor.
      Parameters:
      name - Brand name.
      serviceLevel - Brand service level.
      lastScanDate - Brand last scan date.
  • Method Details

    • toJson

      public String toJson()
      Description copied from interface: Sendable
      Convert the object to json string.
      Specified by:
      toJson in interface Sendable
      Returns:
      The string representation of the json object.
    • fromJson

      public void fromJson(String json)
      Description copied from interface: Sendable
      Convert json string to object.
      Specified by:
      fromJson in interface Sendable
      Parameters:
      json - The string representation of the json object.
    • fromDatalake

      public <T extends DatalakeStorageItem> T fromDatalake(kong.unirest.json.JSONObject object)
      Description copied from class: DatalakeStorageItem
      Create DatalakeStorageItem instance from Datalake data. Be careful to verify if the JSON object parameter is not null. If object is null => return null.
      Specified by:
      fromDatalake in class DatalakeStorageItem
      Type Parameters:
      T - DatalakeStorageItem children.
      Parameters:
      object - Datalake data.
      Returns:
      DatalakeStorageItem instantiated.
    • upsert

      public boolean upsert() throws DatalakeStorageException
      Description copied from class: DatalakeStorageItem
      Upsert the item in Elastic searchContent. This operation cannot be mutualized and must be defined in each children classes.
      Specified by:
      upsert in class DatalakeStorageItem
      Returns:
      True if the upsert is successful.
      Throws:
      DatalakeStorageException - Exception with the storage.
    • getFanoutExchangeName

      public String getFanoutExchangeName()
      Description copied from interface: Sendable
      Get Fanout exchange name.
      Specified by:
      getFanoutExchangeName in interface Sendable
      Returns:
      Fanout exchange name.
    • getId

      public String getId()
      Description copied from class: DatalakeStorageItem
      Item ID.
      Specified by:
      getId in class DatalakeStorageItem
      Returns:
      Item ID.
    • getName

      public String getName()
      Brand name.
      Returns:
      Brand name.
    • setName

      public void setName(String name)
      Brand name.
      Parameters:
      name - Brand name.
    • getServiceLevel

      public int getServiceLevel()
      Brand service level.
      Returns:
      Brand service level.
    • setServiceLevel

      public void setServiceLevel(int serviceLevel)
      Brand service level.
      Parameters:
      serviceLevel - Brand service level.