org.nuiton.eugene.models.object.ObjectModelModifier Maven / Gradle / Ivy
/*
* *##%
* EUGene :: EUGene
* Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* ##%*
*/
package org.nuiton.eugene.models.object;
/**
* ObjectModelModifier
*
* Created: 3 nov. 2009
*
* @author fdesbois
* @version $Revision: 755 $
*
* Mise a jour: $Date: 2009-12-15 00:50:27 +0100 (mar., 15 déc. 2009) $
* par : $Author: tchemit $
*/
public enum ObjectModelModifier {
STATIC("static"),
FINAL("final"),
ABSTRACT("abstract"),
PUBLIC("public"),
PROTECTED("protected"),
PRIVATE("private"),
PACKAGE(""),
AGGREGATE("aggregate"),
COMPOSITE("composite"),
UNIQUE("unique"),
ORDERED("ordered"),
NAVIGABLE("navigable");
private String stringValue;
ObjectModelModifier(String stringValue) {
this.stringValue = stringValue;
}
public boolean isVisibility() {
return this == PUBLIC ||
this == PROTECTED ||
this == PRIVATE ||
this == PACKAGE;
}
public boolean isAssociationType() {
return this == AGGREGATE ||
this == COMPOSITE;
}
@Override
public String toString() {
return stringValue;
}
public static ObjectModelModifier toValue(String name) {
if (name.equals(PUBLIC.toString())) {
return PUBLIC;
} else if (name.equals(PRIVATE.toString())) {
return PRIVATE;
} else if (name.equals(PROTECTED.toString())) {
return PROTECTED;
} else if (name.equals(PACKAGE.toString())) {
return PACKAGE;
} else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy