001/* 002 * Copyright 2013 Box, Inc. All rights reserved. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.nuxeo.box.api.marshalling.dao; 017 018import com.fasterxml.jackson.annotation.JsonProperty; 019 020import java.util.Map; 021 022/** 023 * Version of a file. 024 */ 025public class BoxServiceAction extends BoxObject { 026 027 public static final String FIELD_ID = "id"; 028 029 public static final String FIELD_NAME = "name"; 030 031 public BoxServiceAction() { 032 } 033 034 /** 035 * Copy constructor, this does deep copy for all the fields. 036 * 037 * @param obj 038 */ 039 public BoxServiceAction(BoxServiceAction obj) { 040 super(obj); 041 } 042 043 /** 044 * Instantiate the object from a map. Each entry in the map reflects to a field. 045 * 046 * @param map 047 */ 048 public BoxServiceAction(Map<String, Object> map) { 049 super(map); 050 } 051 052 /** 053 * Get id. 054 * 055 * @return id 056 */ 057 @JsonProperty(FIELD_ID) 058 public String getId() { 059 return (String) getValue(FIELD_ID); 060 } 061 062 /** 063 * Setter. This is only used by {@see <a href="http://jackson.codehaus .org">Jackson JSON processer</a>} 064 * 065 * @param id id 066 */ 067 @JsonProperty(FIELD_ID) 068 private void setId(String id) { 069 put(FIELD_ID, id); 070 } 071 072 @JsonProperty(FIELD_NAME) 073 public String getCreatedBy() { 074 return (String) getValue(FIELD_NAME); 075 } 076 077 @JsonProperty(FIELD_NAME) 078 public void getName(String name) { 079 put(FIELD_NAME, name); 080 } 081 082}