com.threerings.antidote
Class MutabilityHelper

java.lang.Object
  extended by com.threerings.antidote.MutabilityHelper

public class MutabilityHelper
extends Object

A static helper utility for dealing with mutable Ant data.


Constructor Summary
MutabilityHelper()
           
 
Method Summary
static SetStatus areMutablesSet(Mutable... mutables)
          Return a SetStatus enum describing the "set" state, of the list of supplied Mutable objects.
static boolean objectIsNotSet(Object object)
          Checks to see if the supplied Object is not set, e.g.
static boolean objectIsSet(Object object)
          Checks to see if the supplied Object is set, e.g.
static void requiresValidation(Object notNull)
          Alerts the developer via an RequiresValidationException that an object was accessed before validate() or validateField() was called, which is the method where the object is being set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutabilityHelper

public MutabilityHelper()
Method Detail

objectIsSet

public static boolean objectIsSet(Object object)
Checks to see if the supplied Object is set, e.g. not null. It is expected this method would be used as a static import to increase readability as in: if (objectIsSet(object))


objectIsNotSet

public static boolean objectIsNotSet(Object object)
Checks to see if the supplied Object is not set, e.g. null. It is expected this method would be used as a static import to increase readability as in: if (objectIsNotSet(object))


areMutablesSet

public static SetStatus areMutablesSet(Mutable... mutables)
Return a SetStatus enum describing the "set" state, of the list of supplied Mutable objects.


requiresValidation

public static void requiresValidation(Object notNull)
Alerts the developer via an RequiresValidationException that an object was accessed before validate() or validateField() was called, which is the method where the object is being set. This is a workaround for Ant's mutable state. It is expected this method would be used as a static import to increase readability as in: requiresValidation(object);

Throws:
RequiresValidationException - If the supplied object is null


Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.