org.ujoframework.extensions.PropertyModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ujo-orm Show documentation
Show all versions of ujo-orm Show documentation
Quick ORM implementation based on the UJO objects.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.ujoframework.extensions;
/**
* Property Setter
*
TODO: Can I remove the class ?
* @author Ponec
*/
public class PropertyModifier {
/** Write name into property if it is not locked yet. */
@SuppressWarnings("unchecked")
public static void setName(String name, Property property) {
boolean lock = property.isLock();
if (!lock) {
int index = property.getIndex();
property.init(name, null, null, index, false);
}
}
/** Set the new index and lock the property if it is not locked yet. */
@SuppressWarnings("unchecked")
public static void setIndex(int anIndex, Property property) {
boolean lock = property.isLock();
int index = property.getIndex();
if (!lock && index!=anIndex) {
property.init(null, null, null, anIndex, true);
}
}
}