/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.model.util.generated.type.builder; import java.util.List; import org.opendaylight.mdsal.binding.model.api.AccessModifier; import org.opendaylight.mdsal.binding.model.api.AnnotationType; import org.opendaylight.mdsal.binding.model.api.GeneratedProperty; import org.opendaylight.mdsal.binding.model.api.Type; final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty { private final String value; private final boolean readOnly; GeneratedPropertyImpl(final Type definingType, final String name, final List annotations, final String comment, final AccessModifier accessModifier, final Type returnType, final boolean isFinal, final boolean isStatic, final boolean isReadOnly, final String value) { super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic); this.value = value; this.readOnly = isReadOnly; } @Override public String getValue() { return this.value; } @Override public boolean isReadOnly() { return this.readOnly; } @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("GeneratedPropertyImpl [name="); builder.append(getName()); builder.append(", annotations="); builder.append(getAnnotations()); builder.append(", comment="); builder.append(getComment()); if (getDefiningType() != null) { builder.append(", parent="); builder.append(getDefiningType().getPackageName()); builder.append("."); builder.append(getDefiningType().getName()); } else { builder.append(", parent=null"); } builder.append(", returnType="); builder.append(getReturnType()); builder.append(", isFinal="); builder.append(isFinal()); builder.append(", isReadOnly="); builder.append(this.readOnly); builder.append(", modifier="); builder.append(getAccessModifier()); builder.append("]"); return builder.toString(); } }