Class ParametersServiceImpl

java.lang.Object
it.unisa.c03.myPersonalTrainer.parameters.service.ParametersServiceImpl
All Implemented Interfaces:
ParametersService

public class ParametersServiceImpl
extends java.lang.Object
implements ParametersService
  • Constructor Summary

    Constructors
    Constructor Description
    ParametersServiceImpl​(ParametersDAO parametersDAO)  
  • Method Summary

    Modifier and Type Method Description
    Parameters createParameters​(java.lang.String weight, java.lang.String leanMass, java.lang.String fatMass, java.lang.String email)
    check the format parameters.
    java.util.ArrayList<Parameters> getByMail​(java.lang.String email)
    this method show the parameters for the input email.
    boolean saveParameters​(Parameters parameters)
    method to save the new parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParametersServiceImpl

      public ParametersServiceImpl​(ParametersDAO parametersDAO)
  • Method Details

    • createParameters

      public Parameters createParameters​(java.lang.String weight, java.lang.String leanMass, java.lang.String fatMass, java.lang.String email) throws java.lang.IllegalArgumentException, java.io.IOException
      check the format parameters.
      Specified by:
      createParameters in interface ParametersService
      Parameters:
      weight - between 40 and 150 format allowed XXX.XX
      leanMass - between 10% and 70%
      fatMass - between 10% and 70%
      email -
      Returns:
      the parameters, null if the parameters in input are not good
      Throws:
      java.lang.NumberFormatException
      java.lang.IllegalArgumentException
      java.io.IOException
    • saveParameters

      public boolean saveParameters​(Parameters parameters) throws java.io.IOException
      method to save the new parameters.
      Specified by:
      saveParameters in interface ParametersService
      Parameters:
      parameters - the parameters to insert
      Returns:
      true if the parameters are inserted into database
      Throws:
      java.io.IOException
    • getByMail

      public java.util.ArrayList<Parameters> getByMail​(java.lang.String email) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException
      this method show the parameters for the input email.
      Specified by:
      getByMail in interface ParametersService
      Parameters:
      email - mail client who want to retrieve his parameters
      Returns:
      list of parameters
      Throws:
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
      java.io.IOException