All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.engine.ValueInclusion Maven / Gradle / Ivy

There is a newer version: 3.6.0.Beta2
Show newest version
package org.hibernate.engine;

import java.io.Serializable;
import java.io.ObjectStreamException;
import java.io.StreamCorruptedException;

/**
 * An enum of the different ways a value might be "included".
 * 

* This is really an expanded true/false notion with "PARTIAL" being the * expansion. PARTIAL deals with components in the cases where * parts of the referenced component might define inclusion, but the * component overall does not. * * @author Steve Ebersole */ public class ValueInclusion implements Serializable { public static final ValueInclusion NONE = new ValueInclusion( "none" ); public static final ValueInclusion FULL = new ValueInclusion( "full" ); public static final ValueInclusion PARTIAL = new ValueInclusion( "partial" ); private final String name; public ValueInclusion(String name) { this.name = name; } public String getName() { return name; } public String toString() { return "ValueInclusion[" + name + "]"; } private Object readResolve() throws ObjectStreamException { if ( name.equals( NONE.name ) ) { return NONE; } else if ( name.equals( FULL.name ) ) { return FULL; } else if ( name.equals( PARTIAL.name ) ) { return PARTIAL; } else { throw new StreamCorruptedException( "unrecognized value inclusion [" + name + "]" ); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy