Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.fdk
Class ClientUtils

    java.lang.Object
      oracle.ifs.fdk.ClientUtils

    public class ClientUtils

extends java.lang.Object

Utilities for the client side of Web Services, but they can also be used by in-process callers.

Method Summary
`static boolean` | `addNamedValueToMultiMap(java.util.Map map, NamedValue nv)` Adds a NamedValue to a MultiMap.
`static java.util.Calendar` | `convertDate(java.lang.Object date)` Converts an object to a Calendar.
`static java.lang.String` | `fdkExceptionEntryToString(FdkExceptionEntry fdkee)` Returns a String representation of a FdkExceptionEntry, suitable for detail logging.
`static java.lang.String` | `fdkExceptionToString(FdkException fdke, boolean includeStackTrace)` Returns a String representation of a FdkException, suitable for detail logging.
`static NamedValue[]` | `getIdErrorInfo(long id)` Returns an NamedValue[] info filled in with the ID of the object where the error occured.
`static NamedValue[]` | `getIdErrorInfo(java.lang.Long id)` Returns an NamedValue[] info filled in with the ID of the object where the error occured.
`static long[]` | `getSupportedCapabilities()` Returns a list of capabilities that are supported.
`static boolean` | `isDocument(java.lang.String type)` Returns true if the given type is one of the document types.
`static boolean` | `isFolder(java.lang.String type)` Returns true if the given type is one of the folder types.
`static boolean` | `isLink(java.lang.String type)` Returns true if the given type is one of the link types.
`static java.lang.String` | `itemToString(Item item)` Returns a String representation of an Item.
`static NamedValue[]` | `mapToNamedValues(java.util.Map map)` Converts an Map of named values to NamedValue[].
`static NamedValue[]` | `multiMapToNamedValues(java.util.Map map)` Converts a MultiMap of named values to a NamedValue[].
`static int` | `multiMapTotalSize(java.util.Map map)` Gets the total size of the MultiMap.
`static java.util.Map` | `namedValuesToMap(NamedValue[] namedValues)` Converts a NamedValue[] to a Map for easy access.
`static java.util.Map` | `namedValuesToMultiMap(NamedValue[] namedValues)` Converts a NamedValue[] to a MultiMap enabling multiple values to be mapped to a single key.
`static java.lang.String` | `namedValueToString(NamedValue nv)` Returns a String representation of a NamedValue.
`static AttributeRequest` | `newAttributeRequest(java.lang.String attributeName)` Creates a new AttributeRequest without requesting any additional attributes.
`static AttributeRequest` | `newAttributeRequest(java.lang.String attributeName, AttributeRequest[] attributes)` Creates a new AttributeRequest.
`static NamedValue` | `newNamedValue(java.lang.String name, java.lang.Object value)` Creates a new NamedValue.
`static boolean` | `removeNamedValueFromMultiMap(java.util.Map map, NamedValue nv)` Removes the first occurrence of a NamedValue from a MultiMap.
`static java.lang.String` | `stackTraceToString(java.lang.Throwable t)` Converts an exception stack trace to a String.
`static java.lang.String` | `toString(java.lang.Object o)` Returns a String representation of any Object, with special handling for known objects such as Item, NamedValue, FdkException, FdkExceptionEntry, etc.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### namedValuesToMap

    public static final java.util.Map namedValuesToMap(NamedValue[] namedValues)

  Description copied from class: `ClientUtils`
  Converts a NamedValue[] to a Map for easy access. This method guarantees that an Iterator over the Map will return the entries in the same order they were in the array. The keys in the returned map will be of type `String`.

  Parameters:
    `namedValues` - The NamedValue[] to convert. A zero-length array will result into an empty map and a `null` array will result into a `null` return value.

### mapToNamedValues

    public static final NamedValue[] mapToNamedValues(java.util.Map map)

  Description copied from class: `ClientUtils`
  Converts an Map of named values to NamedValue[]. If the Map instance guarantees a certain order, it will be preserved in the array.

  Parameters:
    `map` - The Map to convert. The keys in the map must be of type `String`. An empty map will result in a zero-length NamedValue[] and a `null` map will result in a `null` return value.
  Returns:
    The mapped NamedValue[].

### getIdErrorInfo

    public static NamedValue[] getIdErrorInfo(java.lang.Long id)

  Description copied from class: `ClientUtils`
  Returns an NamedValue[] info filled in with the ID of the object where the error occured.

### getIdErrorInfo

    public static NamedValue[] getIdErrorInfo(long id)

  Description copied from class: `ClientUtils`
  Returns an NamedValue[] info filled in with the ID of the object where the error occured.

### toString

    public static final java.lang.String toString(java.lang.Object o)

  Description copied from class: `ClientUtils`
  Returns a String representation of any Object, with special handling for known objects such as Item, NamedValue, FdkException, FdkExceptionEntry, etc.

  Parameters:
    `o` - Object to convert to a String.
  Returns:
    The converted String.

### itemToString

    public static final java.lang.String itemToString(Item item)

  Description copied from class: `ClientUtils`
  Returns a String representation of an Item.

  Parameters:
    `item` - Item to convert to String.
  Returns:
    The converted String.

### namedValueToString

    public static final java.lang.String namedValueToString(NamedValue nv)

  Description copied from class: `ClientUtils`
  Returns a String representation of a NamedValue.

  Parameters:
    `nv` - NamedValue to convert to String.
  Returns:
    The converted String.

### fdkExceptionToString

    public static final java.lang.String fdkExceptionToString(FdkException fdke,
                                                              boolean includeStackTrace)

  Description copied from class: `ClientUtils`
  Returns a String representation of a FdkException, suitable for detail logging.

  Parameters:
    `fdke` - Exception to convert to String.
    `includeStackTrace` - Whether to include the stack trace of the exception in the returned String.
  Returns:
    The converted String.

### fdkExceptionEntryToString

    public static final java.lang.String fdkExceptionEntryToString(FdkExceptionEntry fdkee)

  Description copied from class: `ClientUtils`
  Returns a String representation of a FdkExceptionEntry, suitable for detail logging.

  Parameters:
    `fdkee` - Entry to convert to String.
  Returns:
    the converted string.

### stackTraceToString

    public static final java.lang.String stackTraceToString(java.lang.Throwable t)

  Description copied from class: `ClientUtils`
  Converts an exception stack trace to a String.

  Parameters:
    `t` - The exception to convert.
  Returns:
    The converted string.

### newNamedValue

    public static final NamedValue newNamedValue(java.lang.String name,
                                                 java.lang.Object value)

  Description copied from class: `ClientUtils`
  Creates a new NamedValue.

  Parameters:
    `name` - The name.
    `value` - The value.
  Returns:
    The NamedValue.
  (Published)

### newAttributeRequest

    public static final AttributeRequest newAttributeRequest(java.lang.String attributeName,
                                                             AttributeRequest[] attributes)

  Description copied from class: `ClientUtils`
  Creates a new AttributeRequest.

  Parameters:
    `attributeName` - The attribute name.
    `attributes` - The requested attributes to be retrieved for the attribute.
  Returns:
    The AttributeRequest.
  (Published)

### newAttributeRequest

    public static final AttributeRequest newAttributeRequest(java.lang.String attributeName)

  Description copied from class: `ClientUtils`
  Creates a new AttributeRequest without requesting any additional attributes.

  Parameters:
    `attributeName` - The attribute name.
  Returns:
    The AttributeRequest.
  (Published)

### isFolder

    public static final boolean isFolder(java.lang.String type)

  Description copied from class: `ClientUtils`
  Returns true if the given type is one of the folder types.

  Parameters:
    `type` - The type to check.
  Returns:
    true if the type is one of the folder types; false otherwise.

### isDocument

    public static final boolean isDocument(java.lang.String type)

  Description copied from class: `ClientUtils`
  Returns true if the given type is one of the document types.

  Parameters:
    `type` - The type to check.
  Returns:
    true if the type is one of the document types; false otherwise.

### isLink

    public static final boolean isLink(java.lang.String type)

  Description copied from class: `ClientUtils`
  Returns true if the given type is one of the link types.

  Parameters:
    `type` - The type to check.
  Returns:
    true if the type is one of the link types; false otherwise.

### convertDate

    public static final java.util.Calendar convertDate(java.lang.Object date)

  Description copied from class: `ClientUtils`
  Converts an object to a Calendar. The argument can already be a Calendar or a Date. This method is useful to account for potential differences between running remotely and in-process.

  Parameters:
    `date` - The Calendar or Date object to convert. For other object types a RuntimeException will be thrown.
  Returns:
    The converted Calendar object.

### getSupportedCapabilities

    public static long[] getSupportedCapabilities()

  Description copied from class: `ClientUtils`
  Returns a list of capabilities that are supported. This is an enumeration of the CAPABILITY_xxx constants defined in FdkConstants.

  Returns:
    long[] of the capabilities that are supported

### namedValuesToMultiMap

    public static java.util.Map namedValuesToMultiMap(NamedValue[] namedValues)

  Description copied from class: `ClientUtils`
  Converts a NamedValue[] to a MultiMap enabling multiple values to be mapped to a single key. This ensures no data loss occurs should multiple NamedValue array elements be provided with the same Name component. The generated Map is of type The Map key corresponds to the Name component of the NamedValue instance and is of type `String`. The Map value is of type `List` and contains a list of NamedValue instance Value components that match the particular key.

  Parameters:
    `namedValues` - The NamedValue[] to convert. A zero-length array will result into an empty map and a `null` array will result into a `null` return value.
  Returns:
    The MultiMap.

### multiMapToNamedValues

    public static NamedValue[] multiMapToNamedValues(java.util.Map map)

  Description copied from class: `ClientUtils`
  Converts a MultiMap of named values to a NamedValue[]. The provided Map must be of type whereby: The Map key corresponds to the Name component of the NamedValue instance and is of type `String`. The Map value is of type `List` and contains a list of NamedValue instance Value components that match the particular key.

  Parameters:
    `map` - The MultiMap to convert. An empty map will result in a zero-length NamedValue[] and a `null` map will result in a `null` return value.
  Returns:
    The mapped NamedValue[].

### multiMapTotalSize

    public static int multiMapTotalSize(java.util.Map map)

  Description copied from class: `ClientUtils`
  Gets the total size of the MultiMap. The provided Map must be of type whereby: The Map key corresponds to the Name component of the NamedValue instance and is of type `String`. The Map value is of type `List` and contains a list of NamedValue instance Value components that match the particular key.

  Parameters:
    `map` - The MultiMap to size.
  Returns:
    The total size of the MultiMap counting all values.

### addNamedValueToMultiMap

    public static boolean addNamedValueToMultiMap(java.util.Map map,
                                                  NamedValue nv)

  Description copied from class: `ClientUtils`
  Adds a NamedValue to a MultiMap. The provided Map must be of type whereby: The Map key corresponds to the Name component of the NamedValue instance and is of type `String`. The Map value is of type `List` and contains a list of NamedValue instance Value components that match the particular key.

  Parameters:
    `map` - The MultiMap to add to.
    `nv` - The NamedValue instance to add.
  Returns:
    true if the list changed as a result of the add

### removeNamedValueFromMultiMap

    public static boolean removeNamedValueFromMultiMap(java.util.Map map,
                                                       NamedValue nv)

  Description copied from class: `ClientUtils`
  Removes the first occurrence of a NamedValue from a MultiMap. The provided Map must be of type whereby: The Map key corresponds to the Name component of the NamedValue instance and is of type `String`. The Map value is of type `List` and contains a list of NamedValue instance Value components that match the particular key.

  Parameters:
    `map` - The MultiMap to remove from.
    `nv` - The NamedValue instance to remove.
  Returns:
    true if the list changed as a result of the remove

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD