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 022public class BoxWebLink extends BoxItem { 023 024 public static final String FIELD_URL = "url"; 025 026 /** 027 * Constructor. 028 */ 029 public BoxWebLink() { 030 setType(BoxResourceType.WEB_LINK.toString()); 031 } 032 033 /** 034 * Copy constructor, this does deep copy for all the fields. 035 * 036 * @param obj 037 */ 038 public BoxWebLink(BoxWebLink obj) { 039 super(obj); 040 } 041 042 /** 043 * Instantiate the object from a map. Each entry in the map reflects to a field. 044 * 045 * @param map 046 */ 047 public BoxWebLink(Map<String, Object> map) { 048 super(map); 049 } 050 051 /** 052 * Get url of the weblink. 053 * 054 * @return url 055 */ 056 @JsonProperty(FIELD_URL) 057 public String getUrl() { 058 return (String) getValue(FIELD_URL); 059 } 060 061 /** 062 * Setter. This is only used by {@see <a href="http://jackson.codehaus .org">Jackson JSON processer</a>} 063 * 064 * @param url url 065 */ 066 @JsonProperty(FIELD_URL) 067 private void setUrl(String url) { 068 put(FIELD_URL, url); 069 } 070}