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

fish.focus.uvms.asset.client.model.search.SearchFields Maven / Gradle / Ivy

There is a newer version: 6.8.35
Show newest version
/*
Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries
© European Union, 2015-2016.

This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can
redistribute it and/or modify it under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a
copy of the GNU General Public License along with the IFDM Suite. If not, see .
 */
package fish.focus.uvms.asset.client.model.search;

import java.util.HashMap;
import java.util.Map;

public enum SearchFields {

	FLAG_STATE("flagStateCode"),
    EXTERNAL_MARKING("externalMarking", true),
    NAME("name"),
    IRCS("ircs", true),
    CFR("cfr"),
    MMSI("mmsi"),
    IMO("imo"),
    ICCAT("iccat"),
    UVI("uvi"),
    GFCM("gfcm"),
    HOMEPORT("portOfRegistration"),
    LICENSE("licenceType"),
    VESSEL_TYPE("vesselType"),
    GUID("id", SearchFieldType.ID),
    HIST_GUID("historyId", SearchFieldType.ID),
    GEAR_TYPE("gearFishingType", SearchFieldType.STRING),
    LENGTH_OVER_ALL("lengthOverAll", SearchFieldType.DECIMAL),
    ENGINE_POWER("powerOfMainEngine", SearchFieldType.DECIMAL),
    PRODUCER_NAME("producerName"),
    DATE(null, SearchFieldType.DATE),
    SOURCE("source", SearchFieldType.STRING),
    HAS_MOBILETERMINAL("mobileTerminals", SearchFieldType.BOOLEAN);

    private String fieldName;
    private SearchFieldType fieldType;
    private boolean fuzzySearch;
    
    private SearchFields(String fieldName) {
        this.fieldName = fieldName;
        this.fieldType = SearchFieldType.LIST;
        this.fuzzySearch = false;
    }

    private SearchFields(String fieldName, SearchFieldType fieldType) {
        this.fieldName = fieldName;
        this.fieldType = fieldType;
        this.fuzzySearch = false;
    }
    
    private SearchFields(String fieldName, boolean fuzzySearch) {
        this.fieldName = fieldName;
        this.fieldType = SearchFieldType.LIST;
        this.fuzzySearch = fuzzySearch;
    }
    
    public String getFieldName() {
        return fieldName;
    }

    public SearchFieldType getFieldType() {
    	return fieldType;
    }

	public boolean isFuzzySearch() {
		return fuzzySearch;
	}
    
    public static Map getMapOfEnums() {
       Map returnMap = new HashMap<>();
        for (SearchFields value : SearchFields.values()) {
           if(value != SearchFields.DATE) {
        	   returnMap.put(value.fieldName.toLowerCase(), value);
           }
        }
		return returnMap;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy