Java Runtime 3.0.1
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
alfa.rt.utils.AlfaUtils Class Reference

Static Public Member Functions

static long estimateSize (AlfaObject alfaObject)
 
static void applyStreamingAsserts (String typeName, IBuilderConfig bc, Stream< AlfaObject > stream)
 
static void notNull (String name, Object o)
 
static long estimateSize (Set< String > strings, AlfaObject alfaObject)
 
static< T extends Builder > T toBuilder (IBuilderConfig cfg, AlfaObject alfaObject)
 
static< T > Try< T > createTryFailure (String msg)
 
static< T > Try< T > createTryObject (T value)
 
static< L, R > Either< L, R > createEitherLeftObject (L value)
 
static< L, R > Either< L, R > createEitherRightObject (R value)
 
static< T, Void > Function< T, Void > buildAssertAllResult ()
 
static Optional< alfa.rt.model.annotation.db.TableDef > getTableAnnotation (AlfaObject ao)
 
static Optional< alfa.rt.model.annotation.db.TableDef > getTableAnnotation (TypeDescriptor descriptor)
 

Detailed Description

Alfa utility methods for constructing various Alfa based objects

Member Function Documentation

◆ createEitherLeftObject()

static< L, R > Either< L, R > alfa.rt.utils.AlfaUtils.createEitherLeftObject ( L value)
inlinestatic

Utility method to create am either left object with the given object as the left value

Parameters
valueValue to be used as the either left result
<L>Class representing the value
Returns
An Either object with a left value set

◆ createEitherRightObject()

static< L, R > Either< L, R > alfa.rt.utils.AlfaUtils.createEitherRightObject ( R value)
inlinestatic

Utility method to create am either left object with the given object as the right value

Parameters
valueValue to be used as the either right result
<L>Class representing the value
Returns
An Either object with a right value set

◆ createTryFailure()

static< T > Try< T > alfa.rt.utils.AlfaUtils.createTryFailure ( String msg)
inlinestatic

Utility method to create a try failure object with the given message

Parameters
msgMessage to be used for the failure reason
<T>Class representing the type expectedd in the Try value
Returns
A Try object with a failure value set

◆ createTryObject()

static< T > Try< T > alfa.rt.utils.AlfaUtils.createTryObject ( T value)
inlinestatic

Utility method to create a try object with the given object as the valid Try result

Parameters
valueValue to be used as the try result
<T>Class representing the value
Returns
A Try object with a result value set

◆ estimateSize() [1/2]

static long alfa.rt.utils.AlfaUtils.estimateSize ( AlfaObject alfaObject)
inlinestatic

Give an estimate of the space consumed to keep this object in memory

Parameters
alfaObjectObject to estimate space for
Returns
Value in bytes indicating space consumed

◆ estimateSize() [2/2]

static long alfa.rt.utils.AlfaUtils.estimateSize ( Set< String > strings,
AlfaObject alfaObject )
inlinestatic

Give an estimate of the space consumed to keep this object in memory

Parameters
stringsCache of strings
alfaObjectObject to estimate space for
Returns
Value in bytes indicating space consumed

◆ toBuilder()

static< T extends Builder > T alfa.rt.utils.AlfaUtils.toBuilder ( IBuilderConfig cfg,
AlfaObject alfaObject )
inlinestatic

Return a Builder for the object, i.e. a mutable version of the immutable object

Parameters
cfgBuilder configuration to be used to construct the object
alfaObjectImmutable object that will be used to craete the newBuilder
Returns
A Builder for the object

The documentation for this class was generated from the following file: