public ErrorDetails validateVacantLandDetails(final CreatePropertyDetails createPropDetails,ErrorDetails errorDetails){
  final VacantLandDetails vacantLandDetails=createPropDetails.getVacantLandDetails();
  if (vacantLandDetails == null) {
    errorDetails=new ErrorDetails();
    errorDetails.setErrorCode(VACANT_LAND_DETAILS_REQ_CODE);
    errorDetails.setErrorMessage(VACANT_LAND_DETAILS_REQ_MSG);
    return errorDetails;
  }
 else {
    if (StringUtils.isBlank(vacantLandDetails.getSurveyNumber())) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(SURVEY_NO_REQ_CODE);
      errorDetails.setErrorMessage(SURVEY_NO_REQ_MSG);
      return errorDetails;
    }
 else     if (StringUtils.isBlank(vacantLandDetails.getPattaNumber())) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(PATTA_NO_REQ_CODE);
      errorDetails.setErrorMessage(PATTA_NO_REQ_MSG);
      return errorDetails;
    }
 else     if (vacantLandDetails.getVacantLandArea() == null) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(VACANT_LAND_AREA_REQ_CODE);
      errorDetails.setErrorMessage(VACANT_LAND_AREA_REQ_MSG);
      return errorDetails;
    }
 else     if (Float.valueOf(vacantLandDetails.getVacantLandArea()) == 0.0) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(AREA_GREATER_THAN_ZERO_CODE);
      errorDetails.setErrorMessage(AREA_GREATER_THAN_ZERO_MSG);
      return errorDetails;
    }
 else     if (vacantLandDetails.getMarketValue() == null) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(MARKET_AREA_VALUE_REQ_CODE);
      errorDetails.setErrorMessage(MARKET_AREA_VALUE_REQ_MSG);
      return errorDetails;
    }
 else     if (Double.valueOf(vacantLandDetails.getMarketValue()) == 0) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(MARKET_VALUE_GREATER_THAN_ZERO_CODE);
      errorDetails.setErrorMessage(MARKET_VALUE_GREATER_THAN_ZERO_MSG);
      return errorDetails;
    }
 else     if (vacantLandDetails.getCurrentCapitalValue() == null) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(CURRENT_CAPITAL_VALUE_REQ_CODE);
      errorDetails.setErrorMessage(CURRENT_CAPITAL_VALUE_REQ_MSG);
      return errorDetails;
    }
 else     if (Double.valueOf(vacantLandDetails.getCurrentCapitalValue()) == 0.0) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(CURRENT_CAPITAL_VALUE_GREATER_THAN_ZERO_CODE);
      errorDetails.setErrorMessage(CURRENT_CAPITAL_VALUE_GREATER_THAN_ZERO_MSG);
      return errorDetails;
    }
 else     if (StringUtils.isBlank(vacantLandDetails.getEffectiveDate())) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(EFFECTIVE_DATE_REQ_CODE);
      errorDetails.setErrorMessage(EFFECTIVE_DATE_REQ_MSG);
      return errorDetails;
    }
    final SurroundingBoundaryDetails surBoundaryDetails=createPropDetails.getSurroundingBoundaryDetails();
    if (surBoundaryDetails == null) {
      errorDetails=new ErrorDetails();
      errorDetails.setErrorCode(SURROUNDING_BOUNDARY_DETAILS_REQ_CODE);
      errorDetails.setErrorMessage(SURROUNDING_BOUNDARY_DETAILS_REQ_MSG);
      return errorDetails;
    }
 else {
      if (StringUtils.isBlank(surBoundaryDetails.getNorthBoundary())) {
        errorDetails=new ErrorDetails();
        errorDetails.setErrorCode(NORTH_BOUNDARY_REQ_CODE);
        errorDetails.setErrorMessage(NORTH_BOUNDARY_REQ_MSG);
        return errorDetails;
      }
 else       if (StringUtils.isBlank(surBoundaryDetails.getSouthBoundary())) {
        errorDetails=new ErrorDetails();
        errorDetails.setErrorCode(SOUTH_BOUNDARY_REQ_CODE);
        errorDetails.setErrorMessage(SOUTH_BOUNDARY_REQ_MSG);
        return errorDetails;
      }
 else       if (StringUtils.isBlank(surBoundaryDetails.getEastBoundary())) {
        errorDetails=new ErrorDetails();
        errorDetails.setErrorCode(EAST_BOUNDARY_REQ_CODE);
        errorDetails.setErrorMessage(EAST_BOUNDARY_REQ_MSG);
        return errorDetails;
      }
 else       if (StringUtils.isBlank(surBoundaryDetails.getWestBoundary())) {
        errorDetails=new ErrorDetails();
        errorDetails.setErrorCode(WEST_BOUNDARY_REQ_CODE);
        errorDetails.setErrorMessage(WEST_BOUNDARY_REQ_MSG);
        return errorDetails;
      }
    }
  }
  return errorDetails;
}

public ErrorDetails validateVacantLandDetails ( final CreatePropertyDetails createPropDetails , ErrorDetails errorDetails ) { final VacantLandDetails vacantLandDetails = createPropDetails . getVacantLandDetails ( ) ; if ( vacantLandDetails == null ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( VACANT_LAND_DETAILS_REQ_CODE ) ; errorDetails . setErrorMessage ( VACANT_LAND_DETAILS_REQ_MSG ) ; return errorDetails ; } else { if ( StringUtils . isBlank ( vacantLandDetails . getSurveyNumber ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( SURVEY_NO_REQ_CODE ) ; errorDetails . setErrorMessage ( SURVEY_NO_REQ_MSG ) ; return errorDetails ; } else if ( StringUtils . isBlank ( vacantLandDetails . getPattaNumber ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( PATTA_NO_REQ_CODE ) ; errorDetails . setErrorMessage ( PATTA_NO_REQ_MSG ) ; return errorDetails ; } else if ( vacantLandDetails . getVacantLandArea ( ) == null ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( VACANT_LAND_AREA_REQ_CODE ) ; errorDetails . setErrorMessage ( VACANT_LAND_AREA_REQ_MSG ) ; return errorDetails ; } else if ( Float . valueOf ( vacantLandDetails . getVacantLandArea ( ) ) == 0.0 ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( AREA_GREATER_THAN_ZERO_CODE ) ; errorDetails . setErrorMessage ( AREA_GREATER_THAN_ZERO_MSG ) ; return errorDetails ; } else if ( vacantLandDetails . getMarketValue ( ) == null ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( MARKET_AREA_VALUE_REQ_CODE ) ; errorDetails . setErrorMessage ( MARKET_AREA_VALUE_REQ_MSG ) ; return errorDetails ; } else if ( Double . valueOf ( vacantLandDetails . getMarketValue ( ) ) == 0 ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( MARKET_VALUE_GREATER_THAN_ZERO_CODE ) ; errorDetails . setErrorMessage ( MARKET_VALUE_GREATER_THAN_ZERO_MSG ) ; return errorDetails ; } else if ( vacantLandDetails . getCurrentCapitalValue ( ) == null ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( CURRENT_CAPITAL_VALUE_REQ_CODE ) ; errorDetails . setErrorMessage ( CURRENT_CAPITAL_VALUE_REQ_MSG ) ; return errorDetails ; } else if ( Double . valueOf ( vacantLandDetails . getCurrentCapitalValue ( ) ) == 0.0 ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( CURRENT_CAPITAL_VALUE_GREATER_THAN_ZERO_CODE ) ; errorDetails . setErrorMessage ( CURRENT_CAPITAL_VALUE_GREATER_THAN_ZERO_MSG ) ; return errorDetails ; } else if ( StringUtils . isBlank ( vacantLandDetails . getEffectiveDate ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( EFFECTIVE_DATE_REQ_CODE ) ; errorDetails . setErrorMessage ( EFFECTIVE_DATE_REQ_MSG ) ; return errorDetails ; } final SurroundingBoundaryDetails surBoundaryDetails = createPropDetails . getSurroundingBoundaryDetails ( ) ; if ( surBoundaryDetails == null ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( SURROUNDING_BOUNDARY_DETAILS_REQ_CODE ) ; errorDetails . setErrorMessage ( SURROUNDING_BOUNDARY_DETAILS_REQ_MSG ) ; return errorDetails ; } else { if ( StringUtils . isBlank ( surBoundaryDetails . getNorthBoundary ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( NORTH_BOUNDARY_REQ_CODE ) ; errorDetails . setErrorMessage ( NORTH_BOUNDARY_REQ_MSG ) ; return errorDetails ; } else if ( StringUtils . isBlank ( surBoundaryDetails . getSouthBoundary ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( SOUTH_BOUNDARY_REQ_CODE ) ; errorDetails . setErrorMessage ( SOUTH_BOUNDARY_REQ_MSG ) ; return errorDetails ; } else if ( StringUtils . isBlank ( surBoundaryDetails . getEastBoundary ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( EAST_BOUNDARY_REQ_CODE ) ; errorDetails . setErrorMessage ( EAST_BOUNDARY_REQ_MSG ) ; return errorDetails ; } else if ( StringUtils . isBlank ( surBoundaryDetails . getWestBoundary ( ) ) ) { errorDetails = new ErrorDetails ( ) ; errorDetails . setErrorCode ( WEST_BOUNDARY_REQ_CODE ) ; errorDetails . setErrorMessage ( WEST_BOUNDARY_REQ_MSG ) ; return errorDetails ; } } } return errorDetails ; }
validates vacant land details
