com.im.commons 5.9

com.im.commons.util
Enum DFSharing

java.lang.Object
  extended by java.lang.Enum<DFSharing>
      extended by com.im.commons.util.DFSharing
All Implemented Interfaces:
Serializable, Comparable<DFSharing>

public enum DFSharing
extends Enum<DFSharing>

Definition of possible sharing types. This enum is used in com.im.df.api.capabilities.DFSharedObjectCapability. For persistence use getCode() instead of name or index of the constant. This codes are stable forever. The number of constant can change in the future, some new can be added.


Enum Constant Summary
PRIVATE
          Object is visible to other users only through action "Copy View/List/Query from other user".
PRIVATE_AND_HIDDEN
          Object is not visible to anyone else.
SHARED
          Object is always visible to all users, object is loaded to memory when user opens the project and schema is loaded.
 
Method Summary
 int getCode()
          Get unique number of this sharing status constant.
 String getDisplayName()
          Display name (description) of this sharing constant.
static String[] getDisplayNames()
           
static DFSharing resolveFromCode(int code)
          Sharing status is stored as integer in DB.
static DFSharing valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DFSharing[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PRIVATE_AND_HIDDEN

public static final DFSharing PRIVATE_AND_HIDDEN
Object is not visible to anyone else. Owner can do any change with it anytime


PRIVATE

public static final DFSharing PRIVATE
Object is visible to other users only through action "Copy View/List/Query from other user". Owner can do any change anytime. Other users will see the version when they obtain it from DB during creation DFNewType (when the internal DIF method is invoked)


SHARED

public static final DFSharing SHARED
Object is always visible to all users, object is loaded to memory when user opens the project and schema is loaded. User is not allowed to do any change in persistent layer, which means DIF methods will throw exception. The object image is copied when user opens the project and loads DIF model.

Method Detail

values

public static DFSharing[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DFSharing c : DFSharing.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DFSharing valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

resolveFromCode

public static DFSharing resolveFromCode(int code)
Sharing status is stored as integer in DB. This method can be used for decoding it from int. If the code is invalid the method throws IllegalArgumentException.

Parameters:
code - The code to be resolved
Returns:
The appropriated sharing constant

getCode

public int getCode()
Get unique number of this sharing status constant. This can be used for DB persistence of sharing.

Returns:
A unique integer code

getDisplayName

public String getDisplayName()
Display name (description) of this sharing constant.

Returns:
The display name of the sharing constant

getDisplayNames

public static String[] getDisplayNames()

com.im.commons 5.9