001/*
002 * (C) Copyright 2017 Nuxeo (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 *     Funsho David
018 *
019 */
020
021package org.nuxeo.ecm.directory;
022
023import org.nuxeo.common.xmap.annotation.XNode;
024import org.nuxeo.common.xmap.annotation.XObject;
025
026/**
027 * @since 9.2
028 */
029@XObject(value = "inverseReference")
030public class InverseReferenceDescriptor implements Cloneable {
031
032    @XNode("@field")
033    protected String fieldName;
034
035    @XNode("@directory")
036    protected String directory;
037
038    @XNode("@dualReferenceField")
039    protected String dualReferenceName;
040
041    @XNode("@readOnly")
042    protected boolean readOnly;
043
044    public String getFieldName() {
045        return fieldName;
046    }
047
048    public void setFieldName(String fieldName) {
049        this.fieldName = fieldName;
050    }
051
052    public String getDirectory() {
053        return directory;
054    }
055
056    public void setDirectory(String directory) {
057        this.directory = directory;
058    }
059
060    public String getDualReferenceName() {
061        return dualReferenceName;
062    }
063
064    public void setDualReferenceName(String dualReferenceName) {
065        this.dualReferenceName = dualReferenceName;
066    }
067
068    public boolean isReadOnly() {
069        return readOnly;
070    }
071
072    public void setReadOnly(boolean readOnly) {
073        this.readOnly = readOnly;
074    }
075
076    @Override
077    public InverseReferenceDescriptor clone() {
078        try {
079            return (InverseReferenceDescriptor) super.clone();
080        } catch (CloneNotSupportedException e) {
081            throw new AssertionError(e);
082        }
083    }
084}