Skip to content
Snippets Groups Projects
ProjectEditRequestPayload.java 1.09 KiB
Newer Older
  • Learn to ignore specific revisions
  • Christos Tranoris's avatar
    Christos Tranoris committed
    package OSM10NBIClient;
    
    import java.util.List;
    import java.util.Map;
    
    import com.fasterxml.jackson.annotation.JsonInclude.Include;
    import com.fasterxml.jackson.core.JsonProcessingException;
    import com.fasterxml.jackson.databind.ObjectMapper;
    
    public class ProjectEditRequestPayload {
    
    	String name;
    	Boolean admin;
    	List<Map<String, Integer>> quotas;
    	
    	public List<Map<String, Integer>> getQuotas() {
    		return quotas;
    	}
    
    	public void setQuotas(List<Map<String, Integer>> quotas) {
    		this.quotas = quotas;
    	}
    
    	public Boolean getAdmin() {
    		return admin;
    	}
    
    	public void setAdmin(Boolean admin) {
    		this.admin = admin;
    	}
    	
    	public String getName() {
    		return name;
    	}
    	
    	public void setName(String name) {
    		this.name = name;
    	}
    
    	public String toJSON()
    	{
    		String jsonInString=null;
    		ObjectMapper mapper = new ObjectMapper();
    		mapper.setSerializationInclusion(Include.NON_NULL);
    		try {
    			jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this);
    		} catch (JsonProcessingException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}	
    		return jsonInString;
    	}
    		
    }