001/*
002 * (C) Copyright 2007 Nuxeo SA (http://nuxeo.com/) and others.
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 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id: DocumentProperty.java 13220 2007-03-03 18:45:30Z bstefanescu $
020 */
021
022package org.nuxeo.ecm.platform.api.ws;
023
024import java.io.Serializable;
025
026/**
027 * Web service document property wrapper.
028 *
029 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a>
030 */
031public class DocumentProperty implements Serializable {
032
033    private static final long serialVersionUID = -5495522067864308283L;
034
035    private String name;
036
037    private String value;
038
039    /**
040     * Empty ctor needed by tools like jaxb.
041     */
042    public DocumentProperty() {
043    }
044
045    public DocumentProperty(String name, String value) {
046        this.name = name;
047        this.value = value;
048    }
049
050    /**
051     * Returns the field name.
052     *
053     * @return the field name
054     */
055    public String getName() {
056        return name;
057    }
058
059    /**
060     * Returns the field value as a string.
061     * <p>
062     * Here, we will always return string for the moment. Request from the <i>Intuition</i> team.
063     *
064     * @return the field value as a string
065     */
066    public String getValue() {
067        return value;
068    }
069
070    /**
071     * @param name the name to set.
072     */
073    public void setName(String name) {
074        this.name = name;
075    }
076
077    /**
078     * @param value the value to set.
079     */
080    public void setValue(String value) {
081        this.value = value;
082    }
083
084    @Override
085    public String toString() {
086        return name + ":" + value;
087    }
088}