signature:
public class LinearSystem { /** * Iteratively improve the solution x to machine accuracy .
 * @ param b
 * the right - hand side column vector
 * @ param x
 * the improved solution column vector
 * @ throws MatrixException
 * if failed to converge */
private void _improve ( final ColumnVector b , final ColumnVector x ) throws MatrixException { } }

implementation:
// Find the largest x element .
float largestX = 0 ; for ( int r = 0 ; r < m_nRows ; ++ r ) { final float absX = Math . abs ( x . m_aValues [ r ] [ 0 ] ) ; if ( largestX < absX ) largestX = absX ; } // Is x already as good as possible ?
if ( largestX == 0 ) return ; final ColumnVector residuals = new ColumnVector ( m_nRows ) ; // Iterate to improve x .
for ( int iter = 0 ; iter < MAX_ITER ; ++ iter ) { // Compute residuals = b - Ax .
// Must use double precision !
for ( int r = 0 ; r < m_nRows ; ++ r ) { double dot = 0 ; for ( int c = 0 ; c < m_nRows ; ++ c ) { final double elmt = at ( r , c ) ; dot += elmt * x . at ( c ) ; // dbl . prec . *
} final double value = b . at ( r ) - dot ; // dbl . prec . -
residuals . set ( r , ( float ) value ) ; } // Solve Az = residuals for z .
final ColumnVector z = solve ( residuals , false ) ; // Set x = x + z .
// Find largest the largest difference .
float largestDiff = 0 ; for ( int r = 0 ; r < m_nRows ; ++ r ) { final float oldX = x . at ( r ) ; x . set ( r , oldX + z . at ( r ) ) ; final float diff = Math . abs ( x . at ( r ) - oldX ) ; if ( largestDiff < diff ) largestDiff = diff ; } // Is any further improvement possible ?
if ( largestDiff < largestX * TOLERANCE ) return ; } // Failed to converge because A is nearly singular .
throw new MatrixException ( MatrixException . NO_CONVERGENCE ) ;


signature:
public class IdentityMatrix { /** * Convert a square matrix into an identity matrix .
 * @ param sm
 * the square matrix to convert */
public static void convert ( final SquareMatrix sm ) { } }

implementation: for ( int r = 0 ; r < sm . m_nRows ; ++ r ) { for ( int c = 0 ; c < sm . m_nCols ; ++ c ) { sm . m_aValues [ r ] [ c ] = ( r == c ) ? 1 : 0 ; } }


signature:
public class RandomExponential { /** * Compute the next randomn value using the von Neumann algorithm . Requires
 * sequences of uniformly - distributed random values in [ 0 , 1 ) . */
public float nextVonNeumann ( ) { } }

implementation:
int n ; int k = 0 ; float u1 ; // Loop to try sequences of uniformly - distributed
// random values .
for ( ; ; ) { n = 1 ; u1 = GENERATOR . nextFloat ( ) ; float u = u1 ; float uPrev = Float . NaN ; // Loop to generate a sequence of ramdom values
// as long as they are decreasing .
for ( ; ; ) { uPrev = u ; u = GENERATOR . nextFloat ( ) ; // No longer decreasing ?
if ( u > uPrev ) { // n is even .
if ( ( n & 1 ) == 0 ) { return u1 + k ; // return a random value
} // n is odd .
++ k ; break ; // try another sequence
} ++ n ; } }


signature:
public class RungeKuttaDiffEqSolver { /** * Return the next data point in the approximation of the solution .
 * @ param h
 * the width of the interval */
@ Override public DataPoint nextPoint ( final float h ) { } }

implementation: final float k1 = m_aEquation . at ( m_fX , m_fY ) ; final float k2 = m_aEquation . at ( m_fX + h / 2 , m_fY + k1 * h / 2 ) ; final float k3 = m_aEquation . at ( m_fX + h / 2 , m_fY + k2 * h / 2 ) ; final float k4 = m_aEquation . at ( m_fX + h , m_fY + k3 * h ) ; m_fY += ( k1 + 2 * ( k2 + k3 ) + k4 ) * h / 6 ; m_fX += h ; return new DataPoint ( m_fX , m_fY ) ;


signature:
public class RegulaFalsiRootFinder { /** * Do the regula falsi iteration procedure .
 * @ param n
 * the iteration count */
@ Override protected void doIterationProcedure ( final int n ) { } }

implementation:
if ( n == 1 ) return ; // already initialized
if ( m_fFalse < 0 ) { m_fXNeg = m_fXFalse ; // the root is in the xPos side
m_fNeg = m_fFalse ; } else { m_fXPos = m_fXFalse ; // the root is in the xNeg side
m_fPos = m_fFalse ; }


signature:
public class RegulaFalsiRootFinder { /** * Compute the next position of x - false . */
@ Override protected void computeNextPosition ( ) { } }

implementation: m_fPrevXFalse = m_fXFalse ; m_fXFalse = m_fXPos - m_fPos * ( m_fXNeg - m_fXPos ) / ( m_fNeg - m_fPos ) ; m_fFalse = m_aFunction . at ( m_fXFalse ) ;


signature:
public class RegulaFalsiRootFinder { /** * Check the position of x - false .
 * @ throws PositionUnchangedException */
@ Override protected void checkPosition ( ) throws AbstractRootFinder . PositionUnchangedException { } }

implementation: if ( EqualsHelper . equals ( m_fXFalse , m_fPrevXFalse ) ) { throw new AbstractRootFinder . PositionUnchangedException ( ) ; }


signature:
public class ImprovedRegulaFalsiRootFinder { /** * Compute the next position of xFalse . */
@ Override protected void computeNextPosition ( ) { } }

implementation:
m_fPrevXFalse = m_fXFalse ; m_fPrevFFalse = m_fFalse ; m_fXFalse = m_fXPos - m_fPos * ( m_fXNeg - m_fXPos ) / ( m_fNeg - m_fPos ) ; m_fFalse = m_aFunction . at ( m_fXFalse ) ; m_bDecreasePos = m_bDecreaseNeg = false ; // If there was no sign change in f ( xFalse ) ,
// or if this is the first iteration step ,
// then decrease the slope of the secant .
if ( Float . isNaN ( m_fPrevFFalse ) || ( m_fPrevFFalse * m_fFalse > 0 ) ) { if ( m_fFalse < 0 ) m_bDecreasePos = true ; else m_bDecreaseNeg = true ; }


signature:
public class AbstractRootFinder { /** * Check the interval .
 * @ param x1
 * x - coordinate of the left of the interval
 * @ param x2
 * x - coordinate of the right end of the interval
 * @ throws InvalidIntervalException */
public void checkInterval ( final float x1 , final float x2 ) throws InvalidIntervalException { } }

implementation:
final float y1 = m_aFunction . at ( x1 ) ; final float y2 = m_aFunction . at ( x2 ) ; // The interval is invalid if y1 and y2 have the same signs .
if ( y1 * y2 > 0 ) throw new InvalidIntervalException ( ) ;


signature:
public class KahanSummation { /** * Add the value of an addend to the running sum .
 * @ param addend
 * the value */
public void add ( final float addend ) { } }

implementation:
// Correct the addend value and add it to the running sum .
m_fCorrectedAddend = addend + m_fCorrection ; final float tempSum = m_fSum + m_fCorrectedAddend ; // Compute the next correction and set the running sum .
// The parentheses are necessary to compute the high - order
// bits of the addend .
m_fCorrection = m_fCorrectedAddend - ( tempSum - m_fSum ) ; m_fSum = tempSum ;


signature:
public class ModuloArithmetic { /** * Multiply two integer values a and b modulo m .
 * @ param pa
 * the value of a
 * @ param pb
 * the value of b
 * @ param m
 * the modulus m
 * @ return the value of ab ( mod m ) */
public static int multiply ( final int pa , final int pb , final int m ) { } }

implementation:
int a = pa ; int b = pb ; int product = 0 ; // Loop to compute product = ( a * b ) % m .
while ( a > 0 ) { // Does the rightmost bit of a = = 1?
if ( ( a & 1 ) == 1 ) { product += b ; product %= m ; } // Double b modulo m , and
// shift a 1 bit to the right .
b <<= 1 ; b %= m ; a >>= 1 ; } return product ;


signature:
public class ModuloArithmetic { /** * Raise a to the b power modulo m .
 * @ param pbase
 * the value of a
 * @ param pexponent
 * the value of b
 * @ param m
 * the modulus m
 * @ return the value of a ^ b ( mod m ) */
public static int raise ( final int pbase , final int pexponent , final int m ) { } }

implementation:
int base = pbase ; int exponent = pexponent ; int power = 1 ; // Loop to compute power = ( base ^ exponent ) % m .
while ( exponent > 0 ) { // Does the rightmost bit of the exponent = = 1?
if ( ( exponent & 1 ) == 1 ) { power = multiply ( power , base , m ) ; } // Square the base modulo m and
// shift the exponent 1 bit to the right .
base = multiply ( base , base , m ) ; exponent >>= 1 ; } return power ;


signature:
public class SecantRootFinder { /** * Do the secant iteration procedure .
 * @ param n
 * the iteration count */
@ Override protected void doIterationProcedure ( final int n ) { } }

implementation:
if ( n == 1 ) return ; // already initialized
// Use the latest two points .
m_fXnm1 = m_fXn ; // x [ n - 1 ] = x [ n ]
m_fXn = m_fXnp1 ; // x [ n ] = x [ n + 1]
m_fFnm1 = m_fFn ; // f ( x [ n - 1 ] ) = f ( x [ n ] )
m_fFn = m_fFnp1 ; // f ( x [ n ] ) = f ( x [ n + 1 ] )


signature:
public class SecantRootFinder { /** * Compute the next position of x [ n + 1 ] . */
@ Override protected void computeNextPosition ( ) { } }

implementation: m_fPrevXnp1 = m_fXnp1 ; m_fXnp1 = m_fXn - m_fFn * ( m_fXnm1 - m_fXn ) / ( m_fFnm1 - m_fFn ) ; m_fFnp1 = m_aFunction . at ( m_fXnp1 ) ;


signature:
public class SldEditor { /** * Create an instance of the SldManager .
 * @ return the SldManager */
public SldManager getSldManager ( ) { } }

implementation: if ( sldManager == null ) { sldManager = new SldManagerImpl ( getEventBus ( ) , getSldEditorServiceFactory ( ) . createSldGwtServiceAsync ( ) ) ; } return sldManager ;


signature:
public class IEEE754 { /** * Convert a long value into a character array of ' 0 ' and ' 1 ' that represents
 * the value in base 2.
 * @ param pvalue
 * the long value
 * @ param size
 * the array size
 * @ return the character array */
private static char [ ] _toCharBitArray ( final long pvalue , final int size ) { } }

implementation:
long value = pvalue ; final char bits [ ] = new char [ size ] ; // Convert each bit from right to left .
for ( int i = size - 1 ; i >= 0 ; -- i ) { bits [ i ] = ( value & 1 ) == 0 ? '0' : '1' ; value >>>= 1 ; } return bits ;


signature:
public class IEEE754 { /** * Decompose a floating - point value into its parts .
 * @ param bits
 * the character array of ' 0 ' and ' 1 ' that represents the value in base
 * @ param bias
 * the exponent bias value
 * @ param reserved
 * the reserved exponent value ( other than 0)
 * @ param signIndex
 * the index of the sign bit
 * @ param signSize
 * the size of the sign bit
 * @ param exponentIndex
 * the index of the exponent
 * @ param exponentSize
 * the size of the exponent
 * @ param fractionIndex
 * the index of the fraction
 * @ param fractionSize
 * the size of the fraction */
private void _decompose ( final char [ ] bits , final int bias , final int reserved , final int signIndex , final int signSize , final int exponentIndex , final int exponentSize , final int fractionIndex , final int fractionSize ) { } }

implementation:
this . m_nBias = bias ; // Extract the individual parts as strings of ' 0 ' and ' 1 ' .
m_sSignBit = new String ( bits , signIndex , signSize ) ; m_sExponentBits = new String ( bits , exponentIndex , exponentSize ) ; m_sFractionBits = new String ( bits , fractionIndex , fractionSize ) ; try { m_nBiased = Integer . parseInt ( m_sExponentBits , 2 ) ; m_nFraction = Long . parseLong ( m_sFractionBits , 2 ) ; } catch ( final NumberFormatException ex ) { } m_bIsZero = ( m_nBiased == 0 ) && ( m_nFraction == 0 ) ; m_bIsDenormalized = ( m_nBiased == 0 ) && ( m_nFraction != 0 ) ; m_bIsReserved = ( m_nBiased == reserved ) ; m_sImpliedBit = m_bIsDenormalized || m_bIsZero || m_bIsReserved ? "0" : "1" ;


signature:
public class IEEE754 { /** * Print the decomposed parts of the value . */
public void print ( @ Nonnull final PrintStream aPW ) { } }

implementation:
aPW . println ( "------------------------------" ) ; // Print the value .
if ( isDouble ( ) ) aPW . println ( "double value = " + doubleValue ( ) ) ; else aPW . println ( "float value = " + floatValue ( ) ) ; // Print the sign .
aPW . print ( "sign=" + signBit ( ) ) ; // Print the bit representation of the exponent and its
// biased and unbiased values . Indicate whether the value
// is denormalized , or whether the exponent is reserved .
aPW . print ( ", exponent=" + exponentBits ( ) + " (biased=" + biasedExponent ( ) ) ; if ( isZero ( ) ) aPW . println ( ", zero)" ) ; else if ( isExponentReserved ( ) ) aPW . println ( ", reserved)" ) ; else if ( isDenormalized ( ) ) aPW . println ( ", denormalized, use " + unbiasedExponent ( ) + ")" ) ; else aPW . println ( ", normalized, unbiased=" + unbiasedExponent ( ) + ")" ) ; // Print the significand .
aPW . println ( "significand=" + significandBits ( ) ) ;


signature:
public class IEEE754 { /** * Validate the value of the float biased exponent value .
 * @ param biased
 * the biased exponent value
 * @ throws com . helger . numbercruncher . mathutils . IEEE754 . IEEE754Exception */
public static void validateFloatBiasedExponent ( final int biased ) throws IEEE754Exception { } }

implementation: if ( ( biased < 0 ) || ( biased > IEEE754Constants . FLOAT_EXPONENT_RESERVED ) ) { throw new IEEE754Exception ( "The biased exponent value should be " + "0 through " + IEEE754Constants . FLOAT_EXPONENT_RESERVED + "." ) ; }


signature:
public class IEEE754 { /** * Validate the value of the float unbiased exponent value .
 * @ param unbiased
 * the unbiased exponent value
 * @ throws com . helger . numbercruncher . mathutils . IEEE754 . IEEE754Exception */
public static void validateFloatUnbiasedExponent ( final int unbiased ) throws IEEE754Exception { } }

implementation: if ( ( unbiased < - IEEE754Constants . FLOAT_EXPONENT_BIAS + 1 ) || ( unbiased > IEEE754Constants . FLOAT_EXPONENT_BIAS ) ) { throw new IEEE754Exception ( "The unbiased exponent value should be " + - ( IEEE754Constants . FLOAT_EXPONENT_BIAS - 1 ) + " through " + IEEE754Constants . FLOAT_EXPONENT_BIAS + "." ) ; }


signature:
public class IEEE754 { /** * Validate the value of the double biased exponent value .
 * @ param biased
 * the biased exponent value
 * @ throws com . helger . numbercruncher . mathutils . IEEE754 . IEEE754Exception */
public static void validateDoubleBiasedExponent ( final int biased ) throws IEEE754Exception { } }

implementation: if ( ( biased < 0 ) || ( biased > IEEE754Constants . DOUBLE_EXPONENT_RESERVED ) ) { throw new IEEE754Exception ( "The biased exponent value should be " + "0 through " + IEEE754Constants . DOUBLE_EXPONENT_RESERVED + "." ) ; }


signature:
public class IEEE754 { /** * Validate the value of the double unbiased exponent value .
 * @ param unbiased
 * the unbiased exponent value
 * @ throws com . helger . numbercruncher . mathutils . IEEE754 . IEEE754Exception */
public static void validateDoubleUnbiasedExponent ( final int unbiased ) throws IEEE754Exception { } }

implementation: if ( ( unbiased < - IEEE754Constants . DOUBLE_EXPONENT_BIAS + 1 ) || ( unbiased > IEEE754Constants . DOUBLE_EXPONENT_BIAS ) ) { throw new IEEE754Exception ( "The unbiased exponent value should be " + - ( IEEE754Constants . DOUBLE_EXPONENT_BIAS - 1 ) + " through " + IEEE754Constants . DOUBLE_EXPONENT_BIAS + "." ) ; }


signature:
public class SldEditorServiceFactory { /** * SldEditorServiceFactory constructor .
 * @ return SldGwtServiceAsync */
public SldGwtServiceAsync createSldGwtServiceAsync ( ) { } }

implementation: this . service = GWT . create ( SldGwtService . class ) ; ServiceDefTarget endpoint = ( ServiceDefTarget ) service ; endpoint . setServiceEntryPoint ( GWT . getHostPageBaseURL ( ) + "d/sldTemplates" ) ; return service ;


signature:
public class RandomNormal { /** * Compute the next random value using the Central Limit Theorem , which states
 * that the averages of sets of uniformly - distributed random values are
 * normally distributed . */
public float nextCentral ( ) { } }

implementation:
// Average 12 uniformly - distributed random values .
float sum = 0.0f ; for ( int j = 0 ; j < 12 ; ++ j ) sum += GENERATOR . nextFloat ( ) ; // Subtract 6 to center about 0.
return m_fStddev * ( sum - 6 ) + m_fMean ;


signature:
public class RandomNormal { /** * Compute the next randomn value using the polar algorithm . Requires two
 * uniformly - distributed random values in [ - 1 , + 1 ) . Actually computes two
 * random values and saves the second one for the next invokation . */
public float nextPolar ( ) { } }

implementation:
// If there ' s a saved value , return it .
if ( m_bHaveNextPolar ) { m_bHaveNextPolar = false ; return m_fNextPolar ; } // point coordinates and their radius
float u1 , u2 , r ; do { // u1 and u2 will be uniformly - distributed
// random values in [ - 1 , + 1 ) .
u1 = 2 * GENERATOR . nextFloat ( ) - 1 ; u2 = 2 * GENERATOR . nextFloat ( ) - 1 ; // Want radius r inside the unit circle .
r = u1 * u1 + u2 * u2 ; } while ( r >= 1 ) ; // Factor incorporates the standard deviation .
final float factor = ( float ) ( m_fStddev * Math . sqrt ( - 2 * Math . log ( r ) / r ) ) ; // v1 and v2 are normally - distributed random values .
final float v1 = factor * u1 + m_fMean ; final float v2 = factor * u2 + m_fMean ; // Save v1 for next time .
m_fNextPolar = v1 ; m_bHaveNextPolar = true ; return v2 ;


signature:
public class RandomNormal { /** * Compute the next random value using the ratio algorithm . Requires two
 * uniformly - distributed random values in [ 0 , 1 ) . */
public float nextRatio ( ) { } }

implementation:
float u , v , x , xx ; do { // u and v are two uniformly - distributed random values
// in [ 0 , 1 ) , and u ! = 0.
while ( ( u = GENERATOR . nextFloat ( ) ) == 0 ) { // try again if 0
} v = GENERATOR . nextFloat ( ) ; // y coord of point ( u , y )
final float y = C1 * ( v - 0.5f ) ; // ratio of point ' s coords
x = y / u ; xx = x * x ; } while ( ( xx > 5f - C2 * u ) && // quick acceptance
( ( xx >= C3 / u + 1.4f ) || // quick rejection
( xx > ( float ) ( - 4 * Math . log ( u ) ) ) ) // final test
) ; return m_fStddev * x + m_fMean ;


signature:
public class PrimeFactors { /** * Compute the Sieve of Eratosthenes .
 * @ param n
 * the size of the sieve
 * @ return the sieve as a boolean array ( each element is true if the
 * corresponding number is prime , false if the number is composite ) */
public static boolean [ ] primeSieve ( final int n ) { } }

implementation:
final int halfN = ( n + 1 ) >> 1 ; final boolean sieve [ ] = new boolean [ n + 1 ] ; // Initialize every integer from 2 onwards to prime .
for ( int i = 2 ; i <= n ; ++ i ) sieve [ i ] = true ; int prime = 2 ; // first prime number
// Loop to create the sieve .
while ( prime < halfN ) { // Mark as composites multiples of the prime .
for ( int composite = prime << 1 ; composite <= n ; composite += prime ) sieve [ composite ] = false ; // Skip over composites to the next prime .
while ( ( ++ prime < halfN ) && ( ! sieve [ prime ] ) ) { } } return sieve ;


signature:
public class PrimeFactors { /** * Compute the prime factors of an integer value .
 * @ param pn
 * the value to factor
 * @ return an array of distinct prime factors */
public static int [ ] factorsOf ( final int pn ) { } }

implementation:
int n = pn ; final boolean isPrime [ ] = primeSieve ( n ) ; // primes < = n
final ICommonsList < Integer > v = new CommonsArrayList < > ( ) ; // Loop to try prime divisors .
for ( int factor = 2 ; n > 1 ; ++ factor ) { if ( isPrime [ factor ] && ( n % factor == 0 ) ) { // Prime divisor found .
v . add ( Integer . valueOf ( factor ) ) ; // Factor out multiples of the divisor .
do { n /= factor ; } while ( n % factor == 0 ) ; } } // Create an array of the distinct prime factors .
final int factors [ ] = new int [ v . size ( ) ] ; for ( int i = 0 ; i < v . size ( ) ; ++ i ) { factors [ i ] = v . get ( i ) . intValue ( ) ; } return factors ;


signature:
public class BisectionRootFinder { /** * Do the bisection iteration procedure .
 * @ param n
 * the iteration count */
@ Override protected void doIterationProcedure ( final int n ) { } }

implementation:
if ( n == 1 ) return ; // already initialized
if ( m_fMid < 0 ) { m_fXNeg = m_fXMid ; // the root is in the xPos half
m_fNeg = m_fMid ; } else { m_fXPos = m_fXMid ; // the root is in the xNeg half
m_fPos = m_fMid ; }


signature:
public class BisectionRootFinder { /** * Compute the next position of xMid . */
@ Override protected void computeNextPosition ( ) { } }

implementation: m_fPrevXMid = m_fXMid ; m_fXMid = ( m_fXNeg + m_fXPos ) / 2 ; m_fMid = m_aFunction . at ( m_fXMid ) ;


signature:
public class BisectionRootFinder { /** * Check the position of xMid .
 * @ throws PositionUnchangedException */
@ Override protected void checkPosition ( ) throws AbstractRootFinder . PositionUnchangedException { } }

implementation: if ( EqualsHelper . equals ( m_fXMid , m_fPrevXMid ) ) { throw new AbstractRootFinder . PositionUnchangedException ( ) ; }


signature:
public class JavaFXExtension { /** * Sets the JavaFX application instance to be provided by the CDI BeanManager .
 * @ param javaFxApplication
 * The JavaFX application instance to be provided by the CDI BeanManager . */
public static void setJavaFxApplication ( final CdiApplication javaFxApplication ) { } }

implementation: final CountDownLatch latch = new CountDownLatch ( 1 ) ; Platform . runLater ( ( ) -> { JAVA_FX_APPLICATION . set ( javaFxApplication ) ; latch . countDown ( ) ; } ) ; if ( ! Platform . isFxApplicationThread ( ) ) { try { latch . await ( ) ; } catch ( InterruptedException e ) { throw new IllegalStateException ( e ) ; } }


signature:
public class Calabash { /** * Settings from a custom calabash . xml */
public void setConfiguration ( File configFile ) { } }

implementation: if ( configFile == null ) nextConfig = null ; else try { XProcConfiguration config = new XProcConfiguration ( "he" , false ) ; nextConfig = config . getProcessor ( ) . newDocumentBuilder ( ) . build ( new SAXSource ( new InputSource ( new FileReader ( configFile ) ) ) ) ; } catch ( FileNotFoundException e ) { throw new IllegalArgumentException ( "Config file does not exist" , e ) ; } catch ( SaxonApiException e ) { throw new RuntimeException ( e ) ; }


signature:
public class Calabash { /** * Settings to be always applied */
public void setDefaultConfiguration ( Reader defaultConfig ) { } }

implementation: XProcConfiguration config = new XProcConfiguration ( "he" , false ) ; try { nextDefaultConfig = config . getProcessor ( ) . newDocumentBuilder ( ) . build ( new SAXSource ( new InputSource ( defaultConfig ) ) ) ; } catch ( SaxonApiException e ) { throw new RuntimeException ( e ) ; }


signature:
public class FXMLComponentBuilder { /** * Retrieves a { @ link javafx . util . StringConverter } instance for the given class .
 * @ param valueClass
 * Class to be used when looking for a matching string converter .
 * @ return
 * A string converter that can handle values of the given class . */
private StringConverter < ? > getStringConverter ( final Class < ? > valueClass ) { } }

implementation: Class < ? extends StringConverter < ? > > aClass = StringConverterRetriever . retrieveConverterFor ( valueClass ) ; if ( aClass == null ) { throw new IllegalArgumentException ( String . format ( "Can't find StringConverter for class '%s'." , valueClass . getName ( ) ) ) ; } try { return aClass . newInstance ( ) ; } catch ( final InstantiationException | IllegalAccessException e ) { throw new IllegalStateException ( e ) ; }


signature:
public class CdiFXMLLoaderFactory { /** * Create a CDI - aware FXMLLoader .
 * If an annotation of type @ FXMLLoaderParams can be found , use it ' s parameters
 * to configure the FXMLLoader instance that shall be used to perform the loading
 * of the FXML file .
 * @ param injectionPoint
 * Injection point .
 * @ return
 * A new FXMLLoader instance . */
@ Produces @ FXMLLoaderParams FXMLLoader createCdiFXMLLoader ( final InjectionPoint injectionPoint ) { } }

implementation: final CdiFXMLLoader fxmlLoader = new CdiFXMLLoader ( ) ; final Annotated annotated = injectionPoint . getAnnotated ( ) ; final Class < ? > declaringClass = injectionPoint . getMember ( ) . getDeclaringClass ( ) ; if ( annotated . isAnnotationPresent ( FXMLLoaderParams . class ) ) { final FXMLLoaderParams annotation = annotated . getAnnotation ( FXMLLoaderParams . class ) ; initializeFXMLLoader ( fxmlLoader , declaringClass , annotation . location ( ) , annotation . resources ( ) , annotation . charset ( ) ) ; } return fxmlLoader ;


signature:
public class CdiFXMLLoaderFactory { /** * Initializes the given FXMLLoader instance using the provided parameters .
 * @ param fxmlLoader never < code > null < / code >
 * @ param targetClass never < code > null < / code >
 * @ param location never < code > null < / code >
 * @ param resources never < code > null < / code >
 * @ param charset never < code > null < / code > */
static void initializeFXMLLoader ( final FXMLLoader fxmlLoader , final Class < ? > targetClass , final String location , final String resources , final String charset ) { } }

implementation: checkAndSetLocation ( fxmlLoader , targetClass , location ) ; if ( charset != null && ! charset . equals ( CHARSET_UNSPECIFIED ) ) { fxmlLoader . setCharset ( Charset . forName ( charset ) ) ; } if ( resources != null && ! resources . equals ( RESOURCES_UNSPECIFIED ) ) { fxmlLoader . setResources ( ResourceBundle . getBundle ( resources ) ) ; }


signature:
public class CdiFXMLLoaderFactory { /** * Checks the location that has been specified ( if any ) and uses the default
 * class loader to create an URL that points to a FXML file on the classpath .
 * @ param fxmlLoader never < code > null < / code >
 * @ param targetClass never < code > null < / code >
 * @ param location never < code > null < / code > and should point to an existing FXML file , an Exception is thrown otherwise */
private static void checkAndSetLocation ( FXMLLoader fxmlLoader , Class < ? > targetClass , String location ) { } }

implementation: if ( location != null && ! location . equals ( LOCATION_UNSPECIFIED ) ) { final URL locationUrl = targetClass . getResource ( location ) ; if ( locationUrl == null ) { throw new IllegalArgumentException ( String . format ( "Couldn't find FXML file: \"%s\"." , location ) ) ; } fxmlLoader . setLocation ( locationUrl ) ; }


signature:
public class EventDefinitionsController { /** * TODO Refactor HATEOAS link building . Time for ResourceAssembler or moving this stuff up the service . Although moving it up will create a circular dep . */
@ RequestMapping ( value = "" , method = { } }

implementation: RequestMethod . GET , RequestMethod . HEAD } ) public Resources < EventDefinitionResource > getEventDefinitions ( ) throws EventDefinitionNotFoundException , ProviderNotFoundException , AttributeDefinitionNotFoundException { if ( LOG . isTraceEnabled ( ) ) { LOG . entry ( ) ; } final Resources < EventDefinitionResource > resources = getEventDefinitions ( eventDefinitionService . getEventDefinitions ( ) ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . exit ( resources ) ; } return resources ;


signature:
public class ReverseGeocodeRequestBuilder { /** * Your ' business ' application ' s API key . This key identifies your
 * application for purposes of quota management .
 * @ param client
 * @ param signature
 * @ return ReverseGeocodeRequestBuilder */
public ReverseGeocodeRequestBuilder key ( String client , String signature ) { } }

implementation: parameters . put ( "client" , client ) ; parameters . put ( "signature" , signature ) ; return this ;


signature:
public class ReverseGeocodeRequestBuilder { /** * The location latitude and longitude .
 * This parameter is required .
 * @ param lat
 * @ param lng
 * @ return ReverseGeocodeRequestBuilder */
public ReverseGeocodeRequestBuilder latlng ( Double lat , Double lng ) { } }

implementation: parameters . put ( "latlng" , lat + "," + lng ) ; return this ;


signature:
public class ServiceRegistryConfigurationProvider { /** * Safely get the information from our convention
 * @ param svc
 * @ return */
public static InetSocketAddress getHostPortPair ( Service svc ) { } }

implementation: try { return new InetSocketAddress ( svc . getMetadata ( ) . get ( "service.host" ) , Integer . parseInt ( svc . getMetadata ( ) . get ( "service.port" ) ) ) ; } catch ( Exception e ) { logger . error ( "Exception extracting metadata from service instance {}" , svc , e ) ; return null ; }


signature:
public class AttrbuteFilterExpressionCollectionEvaluator { /** * Find an attribute definition that applies to a particular attribute filter . */
protected AttributeDefinition getApplicableAttributeDefinition ( final UUID attributeDefinitionUuid , final List < AttributeDefinition > attributeDefinitions ) { } }

implementation: if ( LOG . isTraceEnabled ( ) ) { LOG . entry ( attributeDefinitionUuid , attributeDefinitions ) ; } AttributeDefinition attributeDefinition = null ; for ( AttributeDefinition anAttributeDefinition : attributeDefinitions ) { if ( anAttributeDefinition . getUUID ( ) . equals ( attributeDefinitionUuid ) ) { attributeDefinition = anAttributeDefinition ; break ; } } if ( LOG . isTraceEnabled ( ) ) { LOG . exit ( attributeDefinition ) ; } return attributeDefinition ;


signature:
public class AttrbuteFilterExpressionCollectionEvaluator { /** * Evaluate single attribute filter */
protected boolean evaluate ( final UUID attributeDefinitionUuid , final AttributeFilterExpression attributeFilter , final Map < UUID , String > eventAttributes , final List < AttributeDefinition > attributeDefinitions ) throws ParseException { } }

implementation:
if ( LOG . isTraceEnabled ( ) ) { LOG . entry ( attributeDefinitionUuid , attributeFilter , eventAttributes , attributeDefinitions ) ; } // Find a matching attribute
final String attributeValue = eventAttributes . get ( attributeDefinitionUuid ) ; if ( attributeValue == null ) { // No attribute value to match attribute filter .
if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An attributeValue was not specified for this attribute definition." ) ; LOG . exit ( false ) ; } return false ; } // Find the Attribute definition that matches our filter .
final AttributeDefinition attributeDefinition = getApplicableAttributeDefinition ( attributeDefinitionUuid , attributeDefinitions ) ; if ( attributeDefinition == null ) { // Really shouldn ' t have any filters defined for attributes that don ' t exist .
if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "The attributeDefinition did not exist." ) ; LOG . exit ( false ) ; } return false ; } final Unit unit = attributeDefinition . getUnits ( ) ; try { boolean result = unit . evaluate ( attributeFilter . getOperator ( ) , attributeValue , attributeFilter . getOperand ( ) ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . exit ( result ) ; } return result ; } catch ( ParseException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . throwing ( e ) ; } throw e ; }


signature:
public class PlansEvaluatorServiceImpl { /** * TODO I ' d like to push a lot of this down into NickNack - core . */
protected Action processVariables ( Action origAction , Event cause ) { } }

implementation: final ActionResource newAction = new ActionResource ( ) ; final Map < UUID , String > newParameters = new HashMap < > ( ) ; newAction . setAppliesToActionDefinition ( origAction . getAppliesToActionDefinition ( ) ) ; for ( UUID key : origAction . getAttributes ( ) . keySet ( ) ) { newParameters . put ( key , processVariables ( origAction . getAttributes ( ) . get ( key ) , cause ) ) ; } newAction . setParameters ( newParameters ) ; return newAction ;


signature:
public class RSRServiceCacheImpl { /** * helpers */
private boolean isPertinent ( Event e ) { } }

implementation: return ( e . getPayload ( ) instanceof ServicePayload ) && ( ( ServicePayload ) e . getPayload ( ) ) . getService ( ) . getTags ( ) . contains ( discovery . getType ( ) ) ;


signature:
public class RSRServiceCacheImpl { /** * todo : switch to iterator . */
private void pollAndProcessEvents ( ) { } }

implementation:
MethodOptions options = new MethodOptions ( 100 , null ) ; List < Event > events = null ; int count = 0 ; do { if ( shouldStopPolling ) break ; count += 1 ; try { // get events from server , filter the ones we are interested in .
events = Lists . newArrayList ( discovery . getClient ( ) . getEventsClient ( ) . list ( options ) ) ; String lastEventId = processEvents ( events ) ; options = options . withMarker ( lastEventId ) ; } catch ( Exception ex ) { // todo : just log it .
events = null ; } } while ( events != null && events . size ( ) > 0 ) ; // if it only happened once , assume there are not many events happening .
if ( count == 1 ) { // todo : trace message .
// todo : this should become configurable .
try { Thread . sleep ( 1000 ) ; } catch ( Exception ex ) { } }


signature:
public class Utils { /** * 1 . . 55 chars . anything goes . */
public static String sanitizeTag ( String s ) { } }

implementation:
// if > 55 chars , assume max entropy is at the end ( like a class name ) .
if ( s . length ( ) > MAX_TAG_LENGTH ) { s = s . substring ( s . length ( ) - MAX_TAG_LENGTH ) ; } return s ;


signature:
public class StatesController { /** * TODO Refactor HATEOAS link building . Time for ResourceAssembler or moving this stuff up the service . Although moving it up will create a circular dep . */
@ RequestMapping ( value = "" , method = { } }

implementation: RequestMethod . GET , RequestMethod . HEAD } ) public Resources < StatesResource > getAllStates ( ) throws StateDefinitionNotFoundException , ProviderNotFoundException , AttributeDefinitionNotFoundException { if ( LOG . isTraceEnabled ( ) ) { LOG . entry ( ) ; } final Resources < StatesResource > resources = getAllStates ( statesService . getAllStates ( ) , null ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . exit ( resources ) ; } return resources ;


signature:
public class GeocodeRequestBuilder { /** * Your ' business ' application ' s API key . This key identifies your
 * application for purposes of quota management .
 * @ param client
 * @ param signature
 * @ return GeocodeRequestBuilder */
public GeocodeRequestBuilder key ( String client , String signature ) { } }


signature:
public class GeocodeRequestBuilder { /** * The address that you want to geocode .
 * @ param address
 * @ return GeocodeRequestBuilder */
public GeocodeRequestBuilder address ( String address ) { } }

implementation: parameters . put ( "address" , address != null ? address . replace ( ' ' , '+' ) : address ) ; return this ;


signature:
public class GeocodeRequestBuilder { /** * In a geocoding response , the Google Geocoding API can return address
 * results restricted to a specific area .
 * The restriction is specified using the components filter .
 * A filter consists of a list of component : value pairs separated by a pipe
 * ( | ) . Only the results that match all the filters will be returned .
 * Filter values support the same methods of spelling correction and partial
 * matching as other geocoding requests . If a geocoding result is a partial
 * match for a component filter it will contain a partial _ match field in the
 * response .
 * The components that can be filtered include :
 * route : matches long or short name of a route .
 * locality : matches against both locality and sublocality types .
 * administrative _ area : matches all the administrative _ area levels .
 * postal _ code : matches postal _ code and postal _ code _ prefix .
 * country : matches a country name or a two letter ISO 3166-1 country code .
 * Note : Each address component can only be specified either in the address
 * parameter or as a component filter , but not both . Doing so may result in
 * ZERO _ RESULTS .
 * Countries and administrative areas of level 1 are exempted from this .
 * @ param components
 * @ return GeocodeRequestBuilder */
public GeocodeRequestBuilder componenets ( Map < String , String > components ) { } }

implementation: StringBuffer filters = new StringBuffer ( ) ; for ( Iterator < Map . Entry < String , String > > iterator = components . entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Map . Entry < String , String > entry = iterator . next ( ) ; filters . append ( entry . getKey ( ) + ":" + entry . getValue ( ) != null ? entry . getValue ( ) . replace ( ' ' , '+' ) : entry . getValue ( ) ) ; if ( iterator . hasNext ( ) ) filters . append ( "|" ) ; } parameters . put ( "components" , filters . toString ( ) ) ; return this ;


signature:
public class BarCuratorService { /** * ServiceInstance < T > instances required by the Curator interfaces . */
public static ServiceInstance < BarCuratorService > convert ( BarCuratorService bar ) throws Exception { } }

implementation:
ServiceInstanceBuilder < BarCuratorService > builder = ServiceInstance . builder ( ) ; // these values are for the most part nonsensical .
return builder . payload ( bar ) . uriSpec ( new UriSpec ( "http://" ) ) . sslPort ( 2400 ) . serviceType ( ServiceType . STATIC ) . port ( 2300 ) . address ( "127.0.0.1" ) . id ( String . format ( "bar-%s-%d-%s" , bar . a , bar . b , bar . c ) ) . name ( bar . name ) . build ( ) ;


signature:
public class BarCuratorService { /** * ServiceInstance < T > instances required by the Curator interfaces . */
public static ServiceInstance < BarCuratorService > convert ( Service svc ) throws Exception { } }

implementation: BarCuratorService bar = new BarCuratorService ( svc . getMetadata ( ) . get ( "name" ) , svc . getMetadata ( ) . get ( "a" ) , Integer . parseInt ( svc . getMetadata ( ) . get ( "b" ) ) , Float . parseFloat ( svc . getMetadata ( ) . get ( "c" ) ) ) ; return convert ( bar ) ;


signature:
public class RSRServiceDiscoveryImpl { /** * return all distinct names registered by this discovery type . */
public Collection < String > queryForNames ( ) throws Exception { } }

implementation:
Set < String > names = new HashSet < String > ( ) ; // todo : it would be better to do :
// services = client . getServicesClient ( ) . list ( options , typeTag ) ;
// but there are some validation problems ( the tag is allowed to be written , but not queried on ) .
Iterator < Service > services = client . getServicesClient ( ) . list ( new MethodOptions ( 100 , null ) ) ; while ( services . hasNext ( ) ) { Service service = services . next ( ) ; // this conditional can be removed when the above operation works .
if ( ! service . getTags ( ) . contains ( typeTag ) ) { continue ; } String name = service . getMetadata ( ) . get ( ServiceTracker . NAME ) ; if ( ! names . contains ( name ) ) { names . add ( name ) ; } } return names ;


signature:
public class RSRServiceDiscoveryImpl { /** * return all instances registered to this particular name for this discovery type */
public Collection < ServiceInstance < T > > queryForInstances ( String name ) throws Exception { } }

implementation:
List < ServiceInstance < T > > serviceInstances = new ArrayList < ServiceInstance < T > > ( ) ; Iterator < Service > services = client . getServicesClient ( ) . list ( new MethodOptions ( 100 , null ) ) ; while ( services . hasNext ( ) ) { Service service = services . next ( ) ; if ( service . getTags ( ) . contains ( typeTag ) && service . getMetadata ( ) . get ( ServiceTracker . NAME ) . equals ( name ) ) { // does the job of the serializer in the curator code ( theirs is just a json marshaller anyway ) .
serviceInstances . add ( convert ( service ) ) ; } } return serviceInstances ;


signature:
public class StateDefinitionsController { /** * TODO Refactor HATEOAS link building . Time for ResourceAssembler or moving this stuff up the service . Although moving it up will create a circular dep . */
@ RequestMapping ( value = "" , method = { } }

implementation: RequestMethod . GET , RequestMethod . HEAD } ) public Resources < StateDefinitionResource > getStateDefinitions ( ) throws StateDefinitionNotFoundException , ProviderNotFoundException , AttributeDefinitionNotFoundException { if ( LOG . isTraceEnabled ( ) ) { LOG . entry ( ) ; } final Resources < StateDefinitionResource > resources = getStateDefinitions ( stateDefinitionService . getStateDefinitions ( ) ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . exit ( resources ) ; } return resources ;


signature:
public class Spark { /** * taken from spark ( https : / / github . com / perwendel / spark ) */
public static Map < String , String > getParams ( List < String > request , List < String > matched ) { } }

implementation: Map < String , String > params = new HashMap < > ( ) ; for ( int i = 0 ; ( i < request . size ( ) ) && ( i < matched . size ( ) ) ; i ++ ) { String matchedPart = matched . get ( i ) ; if ( SparkUtils . isParam ( matchedPart ) ) { params . put ( matchedPart . toLowerCase ( ) , request . get ( i ) ) ; } } return Collections . unmodifiableMap ( params ) ;


signature:
public class Spark { /** * taken from spark ( https : / / github . com / perwendel / spark ) */
public static List < String > getSplat ( List < String > request , List < String > matched ) { } }

implementation: int nbrOfRequestParts = request . size ( ) ; int nbrOfMatchedParts = matched . size ( ) ; boolean sameLength = ( nbrOfRequestParts == nbrOfMatchedParts ) ; List < String > splat = new ArrayList < > ( ) ; for ( int i = 0 ; ( i < nbrOfRequestParts ) && ( i < nbrOfMatchedParts ) ; i ++ ) { String matchedPart = matched . get ( i ) ; if ( SparkUtils . isSplat ( matchedPart ) ) { StringBuilder splatParam = new StringBuilder ( request . get ( i ) ) ; if ( ! sameLength && ( i == ( nbrOfMatchedParts - 1 ) ) ) { for ( int j = i + 1 ; j < nbrOfRequestParts ; j ++ ) { splatParam . append ( "/" ) ; splatParam . append ( request . get ( j ) ) ; } } splat . add ( splatParam . toString ( ) ) ; } } return Collections . unmodifiableList ( splat ) ;


signature:
public class FlowItemExecutePacket { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FlowItemExecutePacket }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Fluid Item . . .
if ( this . getFluidItem ( ) != null ) { returnVal . put ( JSONMapping . FLUID_ITEM , this . getFluidItem ( ) . toJsonObject ( ) ) ; } // Flow Step Rule . . .
if ( this . getFlowStepRule ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_RULE , this . getFlowStepRule ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class Configuration { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Flow }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Key . . .
if ( this . getKey ( ) != null ) { returnVal . put ( JSONMapping . KEY , this . getKey ( ) ) ; } // Value . . .
if ( this . getValue ( ) != null ) { returnVal . put ( JSONMapping . VALUE , this . getValue ( ) ) ; } return returnVal ;


signature:
public class CollaborationClient { /** * Create a new Form Container / Electronic Forms .
 * @ param collaborationsParam The Collaboration ' s to create .
 * @ return Created Collaboration ' s .
 * @ see Collaboration */
public List < Collaboration > createCollaboration ( List < Collaboration > collaborationsParam ) { } }

implementation: CollaborationListing collaborationListing = new CollaborationListing ( ) ; collaborationListing . setListing ( collaborationsParam ) ; if ( this . serviceTicket != null ) { collaborationListing . setServiceTicket ( this . serviceTicket ) ; } return new CollaborationListing ( this . putJson ( collaborationListing , WS . Path . Collaboration . Version1 . collaborationCreate ( ) ) ) . getListing ( ) ;


signature:
public class CollaborationClient { /** * Retrieve all Collaboration items TO where logged in user .
 * @ return Created Collaboration ' s .
 * @ see Collaboration */
public List < Collaboration > getAllToByLoggedIn ( ) { } }

implementation: CollaborationListing collaborationListing = new CollaborationListing ( ) ; if ( this . serviceTicket != null ) { collaborationListing . setServiceTicket ( this . serviceTicket ) ; } return new CollaborationListing ( this . postJson ( collaborationListing , WS . Path . Collaboration . Version1 . getAllToByLoggedIn ( ) ) ) . getListing ( ) ;


signature:
public class CollaborationClient { /** * Retrieve all Collaboration items TO where { @ code Form } is { @ code formParam } .
 * @ param formParam The form to fetch collaborations to where sent ' TO ' .
 * @ return Created Collaboration ' s based on { @ code formParam } .
 * @ see Collaboration */
public List < Collaboration > getAllToByForm ( Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new CollaborationListing ( this . postJson ( formParam , WS . Path . Collaboration . Version1 . getAllToByForm ( ) ) ) . getListing ( ) ;


signature:
public class TableRecord { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Field }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Form Container . . .
if ( this . getFormContainer ( ) != null ) { returnVal . put ( JSONMapping . FORM_CONTAINER , this . getFormContainer ( ) . toJsonObject ( ) ) ; } // Parent Form Container . . .
if ( this . getParentFormContainer ( ) != null ) { returnVal . put ( JSONMapping . PARENT_FORM_CONTAINER , this . getParentFormContainer ( ) . toJsonObject ( ) ) ; } // Parent Form Field . . .
if ( this . getParentFormField ( ) != null ) { returnVal . put ( JSONMapping . PARENT_FORM_FIELD , this . getParentFormField ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class RoleToFormFieldToFormDefinition { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToFormFieldToFormDefinition }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Can Create . . .
if ( this . isCanCreateAndModify ( ) != null ) { returnVal . put ( JSONMapping . CAN_CREATE_AND_MODIFY , this . isCanCreateAndModify ( ) . booleanValue ( ) ) ; } // Can View . . .
if ( this . isCanView ( ) != null ) { returnVal . put ( JSONMapping . CAN_VIEW , this . isCanView ( ) . booleanValue ( ) ) ; } // Form Definition . . .
if ( this . getFormFieldToFormDefinition ( ) != null ) { returnVal . put ( JSONMapping . FORM_FIELD_TO_FORM_DEFINITION , this . getFormFieldToFormDefinition ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class FluidTemplate { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FluidTemplate }
 * @ throws JSONException If there is a problem with the JSON Body . */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = new JSONObject ( ) ; // Template Name . . .
if ( this . getTemplateName ( ) != null ) { returnVal . put ( JSONMapping . TEMPLATE_NAME , this . getTemplateName ( ) ) ; } // Template Description . . .
if ( this . getTemplateDescription ( ) != null ) { returnVal . put ( JSONMapping . TEMPLATE_DESCRIPTION , this . getTemplateDescription ( ) ) ; } // Template Comment . . .
if ( this . getTemplateComment ( ) != null ) { returnVal . put ( JSONMapping . TEMPLATE_COMMENT , this . getTemplateComment ( ) ) ; } // Forms and Fields . . .
if ( this . getFormsAndFields ( ) != null && ! this . getFormsAndFields ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Form form : this . getFormsAndFields ( ) ) { jsonArray . put ( form . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FORMS_AND_FIELDS , jsonArray ) ; } // User Queries . . .
if ( this . getUserQueries ( ) != null && ! this . getUserQueries ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( UserQuery userQuery : this . getUserQueries ( ) ) { jsonArray . put ( userQuery . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . USER_QUERIES , jsonArray ) ; } // Flows . . .
if ( this . getFlows ( ) != null && ! this . getFlows ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Flow flow : this . getFlows ( ) ) { jsonArray . put ( flow . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FLOWS , jsonArray ) ; } // Third Party Libraries . . .
if ( this . getThirdPartyLibraries ( ) != null && ! this . getThirdPartyLibraries ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( ThirdPartyLibrary thirdPartyLibrary : this . getThirdPartyLibraries ( ) ) { jsonArray . put ( thirdPartyLibrary . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . THIRD_PARTY_LIBRARIES , jsonArray ) ; } // User Fields . . .
if ( this . getUserFields ( ) != null && ! this . getUserFields ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Field field : this . getUserFields ( ) ) { jsonArray . put ( field . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . USER_FIELDS , jsonArray ) ; } // Route Fields . . .
if ( this . getRouteFields ( ) != null && ! this . getRouteFields ( ) . isEmpty ( ) ) { JSONArray fieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getRouteFields ( ) ) { fieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROUTE_FIELDS , fieldsArr ) ; } // Global Fields . . .
if ( this . getGlobalFields ( ) != null && ! this . getGlobalFields ( ) . isEmpty ( ) ) { JSONArray fieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getGlobalFields ( ) ) { fieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . GLOBAL_FIELDS , fieldsArr ) ; } return returnVal ;


signature:
public class Flow { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Flow }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Flow Steps . . .
if ( this . getFlowSteps ( ) != null && ! this . getFlowSteps ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStep rule : this . getFlowSteps ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FLOW_STEPS , jsonArray ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } return returnVal ;


signature:
public class ABaseFieldClient { /** * Construct the correct Meta - Data from parameters .
 * @ param metaDataPrefixParam Prefix for return val to indicate type . Example ;
 * Spinner .
 * @ param minParam The min allowed value .
 * @ param maxParam The max allowed value .
 * @ param stepFactorParam The allowed step increments .
 * @ param prefixParam The prefix for the decimal , like $ for currency .
 * @ return Correctly formatted Decimal type . */
protected String getMetaDataForDecimalAs ( String metaDataPrefixParam , double minParam , double maxParam , double stepFactorParam , String prefixParam ) { } }

implementation:
StringBuffer returnBuffer = new StringBuffer ( ) ; if ( metaDataPrefixParam != null && ! metaDataPrefixParam . isEmpty ( ) ) { returnBuffer . append ( metaDataPrefixParam ) ; } // Min . . .
returnBuffer . append ( FieldMetaData . Decimal . UNDERSCORE ) ; returnBuffer . append ( FieldMetaData . Decimal . MIN ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_OPEN ) ; returnBuffer . append ( minParam ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_CLOSE ) ; returnBuffer . append ( FieldMetaData . Decimal . UNDERSCORE ) ; // Max . . .
returnBuffer . append ( FieldMetaData . Decimal . MAX ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_OPEN ) ; returnBuffer . append ( maxParam ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_CLOSE ) ; returnBuffer . append ( FieldMetaData . Decimal . UNDERSCORE ) ; // Step Factor . . .
returnBuffer . append ( FieldMetaData . Decimal . STEP_FACTOR ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_OPEN ) ; returnBuffer . append ( stepFactorParam ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_CLOSE ) ; returnBuffer . append ( FieldMetaData . Decimal . UNDERSCORE ) ; // Prefix
String prefix = ( prefixParam == null ) ? "" : prefixParam ; returnBuffer . append ( FieldMetaData . Decimal . PREFIX ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_OPEN ) ; returnBuffer . append ( prefix ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_CLOSE ) ; return returnBuffer . toString ( ) ;


signature:
public class UserClient { /** * Creates a new { @ code User } with the Email , Fields and
 * Roles inside the { @ code userParam } .
 * @ param userParam The { @ code User } to create .
 * @ return The Created User .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see Field
 * @ see com . fluidbpm . program . api . vo . role . Role */
public User createUser ( User userParam ) { } }

implementation: if ( userParam != null && this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . putJson ( userParam , WS . Path . User . Version1 . userCreate ( ) ) ) ;


signature:
public class UserClient { /** * Updates an existing { @ code User } with the Email , Fields and
 * Roles inside the { @ code userParam } .
 * @ param userParam The User to update .
 * @ return The Updated User .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see Field
 * @ see com . fluidbpm . program . api . vo . role . Role */
public User updateUser ( User userParam ) { } }

implementation: if ( userParam != null && this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . postJson ( userParam , WS . Path . User . Version1 . userUpdate ( ) ) ) ;


signature:
public class UserClient { /** * Activate an existing { @ code User } that is currently
 * Deactivated .
 * @ param userParam The User to activate .
 * @ return The Activated User .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see Field
 * @ see com . fluidbpm . program . api . vo . role . Role */
public User activateUser ( User userParam ) { } }

implementation: if ( userParam != null && this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . postJson ( userParam , WS . Path . User . Version1 . userActivate ( ) ) ) ;


signature:
public class UserClient { /** * Deactivate an existing { @ code User } that is currently
 * Active .
 * @ param userParam The User to De - Activate .
 * @ return The DeActivated User .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see Field
 * @ see com . fluidbpm . program . api . vo . role . Role */
public User deActivateUser ( User userParam ) { } }

implementation: if ( userParam != null && this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . postJson ( userParam , WS . Path . User . Version1 . userDeActivate ( ) ) ) ;


signature:
public class UserClient { /** * Increment the invalid login count for { @ code userParam } .
 * @ param userParam The User to increment invalid count for .
 * @ return The User where invalid count performed .
 * @ see com . fluidbpm . program . api . vo . user . User */
public User incrementInvalidLoginForUser ( User userParam ) { } }

implementation: if ( userParam != null && this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . postJson ( userParam , WS . Path . User . Version1 . incrementInvalidLogin ( ) ) ) ;


signature:
public class UserClient { /** * Change the password for the currently logged in user .
 * @ param existingPasswordParam The current password .
 * @ param newPasswordParam The new password .
 * @ param confirmNewPasswordParam The new password again .
 * @ return { @ code User } which password was changed . */
public User changePasswordForLoggedInUser ( String existingPasswordParam , String newPasswordParam , String confirmNewPasswordParam ) { } }

implementation: User toChangePasswordFor = new User ( ) ; if ( this . serviceTicket != null ) { toChangePasswordFor . setServiceTicket ( this . serviceTicket ) ; } String existingPassword = existingPasswordParam == null ? UtilGlobal . EMPTY : existingPasswordParam ; String newPassword = newPasswordParam == null ? UtilGlobal . EMPTY : newPasswordParam ; String confirmNewPassword = confirmNewPasswordParam == null ? UtilGlobal . EMPTY : confirmNewPasswordParam ; JSONObject passwordClear = new JSONObject ( ) ; passwordClear . put ( "existing" , existingPassword ) ; passwordClear . put ( "new" , newPassword ) ; passwordClear . put ( "confirm_new" , confirmNewPassword ) ; toChangePasswordFor . setPasswordClear ( passwordClear . toString ( ) ) ; return new User ( this . postJson ( toChangePasswordFor , WS . Path . User . Version1 . changePassword ( ) ) ) ;


signature:
public class UserClient { /** * Deletes the { @ code User } provided .
 * Id must be set on the { @ code User } .
 * @ param userToDeleteParam The User to Delete .
 * @ param forcefullyDeleteParam Delete the User forcefully .
 * @ return The deleted User . */
public User deleteUser ( User userToDeleteParam , boolean forcefullyDeleteParam ) { } }

implementation: if ( userToDeleteParam != null && this . serviceTicket != null ) { userToDeleteParam . setServiceTicket ( this . serviceTicket ) ; } return new User ( this . postJson ( userToDeleteParam , WS . Path . User . Version1 . userDelete ( forcefullyDeleteParam ) ) ) ;


signature:
public class UserClient { /** * Retrieves user information for the logged in { @ code User } .
 * @ return User information .
 * @ see User */
public User getLoggedInUserInformation ( ) { } }

implementation: User userToGetInfoFor = new User ( ) ; if ( this . serviceTicket != null ) { userToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new User ( this . postJson ( userToGetInfoFor , WS . Path . User . Version1 . userInformation ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves user information for the provided { @ code usernameParam } .
 * @ param usernameParam The username of the user to retrieve info for .
 * @ return User information .
 * @ see User */
public User getUserWhereUsername ( String usernameParam ) { } }

implementation: User userToGetInfoFor = new User ( ) ; userToGetInfoFor . setUsername ( usernameParam ) ; if ( this . serviceTicket != null ) { userToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new User ( this . postJson ( userToGetInfoFor , WS . Path . User . Version1 . getByUsername ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves user information for the provided { @ code emailAddressParam } .
 * The email address must be confirmed .
 * @ param emailAddressParam The confirmed Email of the user to retrieve info for .
 * @ return User information .
 * @ see User */
public User getUserWhereEmail ( String emailAddressParam ) { } }

implementation: User userToGetInfoFor = new User ( ) ; if ( emailAddressParam != null ) { List < String > emailAdd = new ArrayList ( ) ; emailAdd . add ( emailAddressParam ) ; userToGetInfoFor . setEmailAddresses ( emailAdd ) ; } if ( this . serviceTicket != null ) { userToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new User ( this . postJson ( userToGetInfoFor , WS . Path . User . Version1 . getByEmail ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves user information for the provided { @ code userIdParam } .
 * @ param userIdParam The ID of the { @ code User } to retrieve info for .
 * @ return User information .
 * @ see User */
public User getUserById ( Long userIdParam ) { } }

implementation: User userToGetInfoFor = new User ( ) ; userToGetInfoFor . setId ( userIdParam ) ; if ( this . serviceTicket != null ) { userToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new User ( this . postJson ( userToGetInfoFor , WS . Path . User . Version1 . getById ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves all user information .
 * @ return User information .
 * @ see UserListing */
public UserListing getAllUsers ( ) { } }

implementation: UserListing userToGetInfoFor = new UserListing ( ) ; if ( this . serviceTicket != null ) { userToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new UserListing ( this . postJson ( userToGetInfoFor , WS . Path . User . Version1 . getAllUsers ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves all Users by { @ code jobViewParam } .
 * @ return User information at { @ code UserListing }
 * @ param jobViewParam The { @ link JobView } to get users for .
 * @ see UserListing
 * @ see JobView */
public UserListing getAllUsersByJobView ( JobView jobViewParam ) { } }

implementation: if ( this . serviceTicket != null && jobViewParam != null ) { jobViewParam . setServiceTicket ( this . serviceTicket ) ; } try { return new UserListing ( this . postJson ( jobViewParam , WS . Path . User . Version1 . getAllUsersByJobView ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves all Users by { @ code roleParam } .
 * @ return User information at { @ code UserListing }
 * @ param roleParam The { @ link Role } to get users for .
 * @ see UserListing
 * @ see Role */
public UserListing getAllUsersByRole ( Role roleParam ) { } }

implementation: if ( this . serviceTicket != null && roleParam != null ) { roleParam . setServiceTicket ( this . serviceTicket ) ; } try { return new UserListing ( this . postJson ( roleParam , WS . Path . User . Version1 . getAllUsersByRole ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves all Users by { @ code roleParam } .
 * @ return User information at { @ code UserListing }
 * @ param loggedInSinceParam The date for last logged in .
 * @ see UserListing */
public UserListing getAllUsersWhereLoggedInSince ( Date loggedInSinceParam ) { } }

implementation: User userToPost = new User ( ) ; userToPost . setLoggedInDateTime ( loggedInSinceParam ) ; if ( this . serviceTicket != null ) { userToPost . setServiceTicket ( this . serviceTicket ) ; } try { return new UserListing ( this . postJson ( userToPost , WS . Path . User . Version1 . getAllUsersWhereLoggedInSince ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieves all user field values information by the { @ code userParam } .
 * @ param userParam The { @ code User } to retrieve the field values for .
 * @ return User information .
 * @ see UserFieldListing */
public UserFieldListing getAllUserFieldValuesByUser ( User userParam ) { } }

implementation: if ( userParam == null ) { return null ; } if ( this . serviceTicket != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } try { return new UserFieldListing ( this . postJson ( userParam , WS . Path . User . Version1 . getUserFieldValuesByUser ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserClient { /** * Retrieve the gravatar bytes by email .
 * @ param emailAddressParam The email to use for the gravatar .
 * @ param sizeParam The pixel dimension for the image .
 * @ return JPEG image bytes . */
public byte [ ] getGravatarForEmail ( String emailAddressParam , int sizeParam ) { } }

implementation:
try { JSONObject gravatarJSONObj = this . getJson ( WS . Path . User . Version1 . getGravatarByEmail ( emailAddressParam , sizeParam ) ) ; String base64Text = gravatarJSONObj . optString ( JSON_TAG_DATA , "" ) ; if ( base64Text == null || base64Text . isEmpty ( ) ) { return null ; } return UtilGlobal . decodeBase64 ( base64Text ) ; } // JSON Parsing . . .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; } // Encoding not supported . . .
catch ( UnsupportedEncodingException unsEncExcept ) { throw new FluidClientException ( unsEncExcept . getMessage ( ) , unsEncExcept , FluidClientException . ErrorCode . IO_ERROR ) ; }


signature:
public class UserClient { /** * Retrieve the gravatar bytes for Fluid user .
 * @ param userParam The user to get the gravatar for .
 * @ param sizeParam The pixel dimension for the image .
 * @ return JPEG image bytes . */
public byte [ ] getGravatarForUser ( User userParam , int sizeParam ) { } }

implementation:
if ( userParam == null ) { return null ; } try { JSONObject gravatarJSONObj = this . postJson ( userParam , WS . Path . User . Version1 . getGravatarByUser ( sizeParam ) ) ; String base64Text = gravatarJSONObj . optString ( JSON_TAG_DATA , "" ) ; if ( base64Text == null || base64Text . isEmpty ( ) ) { return null ; } return UtilGlobal . decodeBase64 ( base64Text ) ; } // JSON problem . . .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class User { /** * Check whether { @ code this } { @ code User } has access
 * to role { @ code roleParam } .
 * @ param roleParam The role to check for .
 * @ return { @ code true } if user has access , otherwise { @ code false } .
 * @ see Role */
@ XmlTransient public boolean doesUserHaveAccessToRole ( Role roleParam ) { } }

implementation: if ( roleParam == null ) { return false ; } return this . doesUserHaveAccessToRole ( roleParam . getName ( ) ) ;


signature:
public class User { /** * Check whether { @ code this } { @ code User } has access
 * to role with name { @ code roleParam } .
 * @ param roleNameParam The role name to check for .
 * @ return { @ code true } if user has access , otherwise { @ code false } .
 * @ see Role */
@ XmlTransient public boolean doesUserHaveAccessToRole ( String roleNameParam ) { } }

implementation: if ( roleNameParam == null || roleNameParam . trim ( ) . isEmpty ( ) ) { return false ; } if ( this . getRoles ( ) == null || this . getRoles ( ) . isEmpty ( ) ) { return false ; } String roleNameParamLower = roleNameParam . trim ( ) . toLowerCase ( ) ; for ( Role roleAtIndex : this . getRoles ( ) ) { if ( roleAtIndex . getName ( ) == null || roleAtIndex . getName ( ) . trim ( ) . isEmpty ( ) ) { continue ; } String iterRoleNameLower = roleAtIndex . getName ( ) . trim ( ) . toLowerCase ( ) ; if ( roleNameParamLower . equals ( iterRoleNameLower ) ) { return true ; } } return false ;


signature:
public class User { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code User }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Active . . .
returnVal . put ( JSONMapping . ACTIVE , this . isActive ( ) ) ; // Invalid Login Count . . .
returnVal . put ( JSONMapping . INVALID_LOGIN_COUNT , this . getInvalidLoginCount ( ) ) ; // Username . . .
if ( this . getUsername ( ) != null ) { returnVal . put ( JSONMapping . USERNAME , this . getUsername ( ) ) ; } // Password Sha 256 . . .
if ( this . getPasswordSha256 ( ) != null ) { returnVal . put ( JSONMapping . PASSWORD_SHA_256 , this . getPasswordSha256 ( ) ) ; } // Password Clear . . .
if ( this . getPasswordClear ( ) != null ) { returnVal . put ( JSONMapping . PASSWORD_CLEAR , this . getPasswordClear ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( User . JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( User . JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } // Password Changed At . . .
if ( this . getPasswordChangedAt ( ) != null ) { returnVal . put ( JSONMapping . PASSWORD_CHANGED_AT , this . getDateAsLongFromJson ( this . getPasswordChangedAt ( ) ) ) ; } // Logged In Date Time . . .
if ( this . getLoggedInDateTime ( ) != null ) { returnVal . put ( JSONMapping . LOGGED_IN_DATE_TIME , this . getDateAsLongFromJson ( this . getLoggedInDateTime ( ) ) ) ; } // SALT . . .
if ( this . getSalt ( ) != null ) { returnVal . put ( JSONMapping . SALT , this . getSalt ( ) ) ; } // Timezone . . .
if ( this . getTimezone ( ) != null ) { returnVal . put ( JSONMapping . TIMEZONE , this . getTimezone ( ) . doubleValue ( ) ) ; } // Date Format . . .
if ( this . getDateFormat ( ) != null ) { returnVal . put ( JSONMapping . DATE_FORMAT , this . getDateFormat ( ) ) ; } // Time Format . . .
if ( this . getTimeFormat ( ) != null ) { returnVal . put ( JSONMapping . TIME_FORMAT , this . getTimeFormat ( ) ) ; } // Locale . . .
if ( this . getLocale ( ) != null ) { returnVal . put ( JSONMapping . LOCALE , this . getLocale ( ) ) ; } // Email Notification . . .
returnVal . put ( JSONMapping . EMAIL_USER_NOTIFICATION , this . isEmailUserNotification ( ) ) ; // Roles . . .
if ( this . getRoles ( ) != null && ! this . getRoles ( ) . isEmpty ( ) ) { JSONArray rolesArr = new JSONArray ( ) ; for ( Role toAdd : this . getRoles ( ) ) { rolesArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROLES , rolesArr ) ; } // Email Addresses . . .
if ( this . getEmailAddresses ( ) != null && ! this . getEmailAddresses ( ) . isEmpty ( ) ) { JSONArray emailArr = new JSONArray ( ) ; for ( String toAdd : this . getEmailAddresses ( ) ) { emailArr . put ( toAdd ) ; } returnVal . put ( JSONMapping . EMAIL_ADDRESSES , emailArr ) ; } // User Fields . . .
if ( this . getUserFields ( ) != null && ! this . getUserFields ( ) . isEmpty ( ) ) { JSONArray userFieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getUserFields ( ) ) { userFieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . USER_FIELDS , userFieldsArr ) ; } return returnVal ;


signature:
public class User { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getUserFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the User Field as in Fluid .
 * @ return The value for the Field as { @ code Object } .
 * @ see Field */
@ XmlTransient public Field getField ( String fieldNameParam ) { } }

implementation: if ( fieldNameParam == null || fieldNameParam . trim ( ) . isEmpty ( ) ) { return null ; } if ( this . userFields == null || this . userFields . isEmpty ( ) ) { return null ; } String fieldNameParamLower = fieldNameParam . trim ( ) . toLowerCase ( ) ; for ( Field field : this . userFields ) { String fieldName = field . getFieldName ( ) ; if ( fieldName == null || fieldName . trim ( ) . isEmpty ( ) ) { continue ; } String fieldNameLower = fieldName . trim ( ) . toLowerCase ( ) ; if ( fieldNameParamLower . equals ( fieldNameLower ) ) { return field ; } } return null ;


signature:
public class User { /** * Gets the value of { @ code this } { @ code Field } as a { @ code MultiChoice } .
 * @ param fieldNameParam The name of the field get get { @ code MultiChoice } from .
 * @ return The Field Value or { @ code null } if not found .
 * @ see Field . Type
 * @ see MultiChoice */
@ XmlTransient public MultiChoice getFieldValueAsMultiChoice ( String fieldNameParam ) { } }

implementation: Field fieldReturn = this . getField ( fieldNameParam ) ; return ( fieldReturn == null ) ? null : fieldReturn . getFieldValueAsMultiChoice ( ) ;


signature:
public class RoleToJobView { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToJobView }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Job View . . .
if ( this . getJobView ( ) != null ) { returnVal . put ( JSONMapping . JOB_VIEW , this . getJobView ( ) . toJsonObject ( ) ) ; } // Role . . .
if ( this . getRole ( ) != null ) { returnVal . put ( JSONMapping . ROLE , this . getRole ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code String } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public String getFieldValueAsString ( ) { } }

implementation: Object returnObj = this . getFieldValue ( ) ; return ( returnObj == null ) ? null : returnObj . toString ( ) ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Double } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Double getFieldValueAsDouble ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof Double ) { return ( Double ) obj ; } if ( obj instanceof Number ) { return ( ( Number ) obj ) . doubleValue ( ) ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Long } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Long getFieldValueAsLong ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof Long ) { return ( Long ) obj ; } if ( obj instanceof Number ) { return ( ( Number ) obj ) . longValue ( ) ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Integer } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Integer getFieldValueAsInteger ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof Integer ) { return ( Integer ) obj ; } if ( obj instanceof Number ) { return ( ( Number ) obj ) . intValue ( ) ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Number } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Number getFieldValueAsNumber ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof Number ) { return ( Number ) obj ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Boolean } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Boolean getFieldValueAsBoolean ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof Boolean ) { return ( Boolean ) obj ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code Date } .
 * @ return The Field Value .
 * @ see Type */
@ XmlTransient public Date getFieldValueAsDate ( ) { } }

implementation:
Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } // Real Date . . .
if ( obj instanceof Date ) { return ( Date ) obj ; } // Long . . .
else if ( obj instanceof Long ) { Long longValue = ( Long ) obj ; if ( longValue . longValue ( ) > 0 ) { return new Date ( longValue . longValue ( ) ) ; } } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code MultiChoice } .
 * @ return The Field Value .
 * @ see Type
 * @ see MultiChoice */
@ XmlTransient public MultiChoice getFieldValueAsMultiChoice ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof MultiChoice ) { return ( MultiChoice ) obj ; } return null ;


signature:
public class Field { /** * Gets the value of { @ code this } { @ code Field } as a { @ code TableField } .
 * @ return The Field Value .
 * @ see Type
 * @ see TableField */
@ XmlTransient public TableField getFieldValueAsTableField ( ) { } }

implementation: Object obj = this . getFieldValue ( ) ; if ( obj == null ) { return null ; } if ( obj instanceof TableField ) { return ( TableField ) obj ; } return null ;


signature:
public class Field { /** * Sets the value of { @ code this } { @ code Field } .
 * @ param fieldValueParam The New Field Value .
 * @ see Type */
public void setFieldValue ( Object fieldValueParam ) { } }

implementation:
this . fieldValue = fieldValueParam ; if ( this . getFieldType ( ) == null && fieldValueParam != null ) { // Date . . .
if ( fieldValueParam instanceof Date ) { this . setTypeAsEnum ( Type . DateTime ) ; } // Number . . .
else if ( fieldValueParam instanceof Number ) { this . setTypeAsEnum ( Type . Decimal ) ; } // MultiChoice . . .
else if ( fieldValueParam instanceof MultiChoice ) { this . setTypeAsEnum ( Type . MultipleChoice ) ; } // Table Field . . .
else if ( fieldValueParam instanceof TableField ) { this . setTypeAsEnum ( Type . Table ) ; } // Text . . .
else if ( fieldValueParam instanceof String ) { this . setTypeAsEnum ( Type . Text ) ; } // Boolean . . .
else if ( fieldValueParam instanceof Boolean ) { this . setTypeAsEnum ( Type . TrueFalse ) ; } }


signature:
public class Field { /** * Sets the Type of { @ code this } { @ code Field } as { @ code enum } .
 * @ param typeParam The Field fieldType .
 * @ see Type */
@ XmlTransient public void setTypeAsEnum ( Type typeParam ) { } }

implementation: if ( typeParam == null ) { this . fieldType = null ; return ; } this . fieldType = typeParam . name ( ) ;


signature:
public class Field { /** * Gets the Type of { @ code this } { @ code Field } as { @ code enum } .
 * @ return The Field fieldType .
 * @ see Type */
@ XmlTransient public Type getTypeAsEnum ( ) { } }

implementation: if ( this . getFieldType ( ) == null || this . getFieldType ( ) . trim ( ) . isEmpty ( ) ) { return null ; } return Type . valueOf ( this . getFieldType ( ) ) ;


signature:
public class Field { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Field }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Field Name . . .
if ( this . getFieldName ( ) != null ) { returnVal . put ( JSONMapping . FIELD_NAME , this . getFieldName ( ) ) ; } // Field Description . . .
if ( this . getFieldDescription ( ) != null ) { returnVal . put ( JSONMapping . FIELD_DESCRIPTION , this . getFieldDescription ( ) ) ; } // Field Value . . .
if ( this . getFieldValue ( ) != null ) { // Text . . .
if ( this . getFieldValue ( ) instanceof String ) { returnVal . put ( JSONMapping . FIELD_VALUE , this . getFieldValue ( ) ) ; } // Decimal . . .
else if ( this . getFieldValue ( ) instanceof Number ) { returnVal . put ( JSONMapping . FIELD_VALUE , ( ( Number ) this . getFieldValue ( ) ) . doubleValue ( ) ) ; } // True False . . .
else if ( this . getFieldValue ( ) instanceof Boolean ) { returnVal . put ( JSONMapping . FIELD_VALUE , ( Boolean ) this . getFieldValue ( ) ) ; } // Date Time . . .
else if ( this . getFieldValue ( ) instanceof Date ) { returnVal . put ( JSONMapping . FIELD_VALUE , this . getDateAsLongFromJson ( ( Date ) this . getFieldValue ( ) ) ) ; } // Multi Choice . . .
else if ( this . getFieldValue ( ) instanceof MultiChoice ) { returnVal . put ( JSONMapping . FIELD_VALUE , ( ( MultiChoice ) this . getFieldValue ( ) ) . toJsonObject ( ) ) ; } // Table Field . . .
else if ( this . getFieldValue ( ) instanceof TableField ) { returnVal . put ( JSONMapping . FIELD_VALUE , ( ( TableField ) this . getFieldValue ( ) ) . toJsonObject ( ) ) ; } else { returnVal . put ( JSONMapping . FIELD_VALUE , this . getFieldValue ( ) ) ; } } // Type . . .
if ( this . getFieldType ( ) != null ) { returnVal . put ( JSONMapping . FIELD_TYPE , this . getFieldType ( ) ) ; } // Type Meta Data . . .
if ( this . getTypeMetaData ( ) != null ) { returnVal . put ( JSONMapping . TYPE_META_DATA , this . getTypeMetaData ( ) ) ; } return returnVal ;


signature:
public class Field { /** * Creates the mapping object required by Elastic Search when making
 * use of enhanced data - types .
 * See { @ code https : / / www . elastic . co / guide / en / elasticsearch / reference / current / mapping - types . html } .
 * @ return { @ code JSONObject } representation of { @ code Field } for
 * ElasticSearch mapping .
 * @ throws JSONException If there is a problem with the JSON Body . */
@ Override @ XmlTransient public JSONObject toJsonMappingForElasticSearch ( ) throws JSONException { } }

implementation: String fieldNameUpperCamel = this . getFieldNameAsUpperCamel ( ) ; if ( fieldNameUpperCamel == null ) { return null ; } String elasticType = this . getElasticSearchFieldType ( ) ; if ( elasticType == null ) { return null ; } JSONObject returnVal = new JSONObject ( ) ; returnVal . put ( JSONMapping . Elastic . MAPPING_ONLY_TYPE , elasticType ) ; return returnVal ;


signature:
public class Field { /** * Conversion to { @ code JSONObject } for storage in ElasticSearch .
 * @ return { @ code JSONObject } representation of { @ code Field }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonForElasticSearch ( ) throws JSONException { } }

implementation:
if ( ! this . doesFieldQualifyForElasticSearchInsert ( ) ) { return null ; } JSONObject returnVal = new JSONObject ( ) ; String fieldIdAsString = this . getFieldNameAsUpperCamel ( ) ; Object fieldValue = this . getFieldValue ( ) ; // Table Field . . .
if ( fieldValue instanceof TableField ) { TableField tableField = ( TableField ) this . getFieldValue ( ) ; if ( tableField . getTableRecords ( ) != null && ! tableField . getTableRecords ( ) . isEmpty ( ) ) { JSONArray array = new JSONArray ( ) ; for ( Form record : tableField . getTableRecords ( ) ) { if ( record . getId ( ) == null ) { continue ; } array . put ( record . getId ( ) ) ; } returnVal . put ( fieldIdAsString , array ) ; } } // Multiple Choice . . .
else if ( fieldValue instanceof MultiChoice ) { MultiChoice multiChoice = ( MultiChoice ) this . getFieldValue ( ) ; if ( multiChoice . getSelectedMultiChoices ( ) != null && ! multiChoice . getSelectedMultiChoices ( ) . isEmpty ( ) ) { JSONArray array = new JSONArray ( ) ; for ( String selectedChoice : multiChoice . getSelectedMultiChoices ( ) ) { Long selectedChoiceAsLong = null ; try { if ( ! selectedChoice . isEmpty ( ) && Character . isDigit ( selectedChoice . charAt ( 0 ) ) ) { selectedChoiceAsLong = Long . parseLong ( selectedChoice ) ; } } catch ( NumberFormatException nfe ) { selectedChoiceAsLong = null ; } // When not long , store as is . . .
if ( selectedChoiceAsLong == null ) { array . put ( selectedChoice ) ; } else { array . put ( selectedChoiceAsLong . longValue ( ) ) ; } } returnVal . put ( fieldIdAsString , array ) ; } } // Other valid types . . .
else if ( ( fieldValue instanceof Number || fieldValue instanceof Boolean ) || fieldValue instanceof String ) { if ( ( fieldValue instanceof String ) && LATITUDE_AND_LONGITUDE . equals ( this . getTypeMetaData ( ) ) ) { String formFieldValueStr = fieldValue . toString ( ) ; UtilGlobal utilGlobal = new UtilGlobal ( ) ; String latitude = utilGlobal . getLatitudeFromFluidText ( formFieldValueStr ) ; String longitude = utilGlobal . getLongitudeFromFluidText ( formFieldValueStr ) ; fieldValue = ( latitude . concat ( UtilGlobal . COMMA ) . concat ( longitude ) ) ; } returnVal . put ( fieldIdAsString , fieldValue ) ; } // Date . . .
else if ( fieldValue instanceof Date ) { returnVal . put ( fieldIdAsString , ( ( Date ) fieldValue ) . getTime ( ) ) ; } // Problem
else { throw new FluidElasticSearchException ( "Field Value of field-type '" + fieldValue . getClass ( ) . getSimpleName ( ) + "' and Value '" + fieldValue + "' is not supported." ) ; } return returnVal ;


signature:
public class Field { /** * Populate the object based on the ElasticSearch JSON structure .
 * @ param jsonObjectParam The JSON object to populate from .
 * @ return { @ link Field } - The field to be added , if invalid a { @ code null }
 * will be returned .
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ XmlTransient public Field populateFromElasticSearchJson ( JSONObject jsonObjectParam ) throws JSONException { } }

implementation:
if ( this . getFieldNameAsUpperCamel ( ) == null ) { return null ; } String fieldIdAsString = this . getFieldNameAsUpperCamel ( ) ; if ( jsonObjectParam . isNull ( fieldIdAsString ) ) { return null ; } Field . Type type ; if ( ( type = this . getTypeAsEnum ( ) ) == null ) { return null ; } Object formFieldValue = jsonObjectParam . get ( fieldIdAsString ) ; Field fieldToAdd = null ; switch ( type ) { case DateTime : if ( formFieldValue instanceof Long ) { fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , new Date ( ( ( Long ) formFieldValue ) . longValue ( ) ) , type ) ; } break ; case Decimal : if ( formFieldValue instanceof Number ) { fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , ( ( Number ) formFieldValue ) . doubleValue ( ) , type ) ; } break ; case MultipleChoice : if ( formFieldValue instanceof JSONArray ) { JSONArray casted = ( JSONArray ) formFieldValue ; List < String > selectedChoices = new ArrayList ( ) ; for ( int index = 0 ; index < casted . length ( ) ; index ++ ) { selectedChoices . add ( casted . get ( index ) . toString ( ) ) ; } if ( selectedChoices . isEmpty ( ) ) { return null ; } MultiChoice multiChoiceToSet = new MultiChoice ( selectedChoices ) ; fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , multiChoiceToSet , type ) ; } break ; case Table : List < Form > tableRecords = new ArrayList ( ) ; // When array already . . .
if ( formFieldValue instanceof JSONArray ) { JSONArray casted = ( JSONArray ) formFieldValue ; for ( int index = 0 ; index < casted . length ( ) ; index ++ ) { Object obAtIndex = casted . get ( index ) ; if ( obAtIndex instanceof Number ) { tableRecords . add ( new Form ( ( ( Number ) obAtIndex ) . longValue ( ) ) ) ; } } } // When there is only a single number stored . . .
else if ( formFieldValue instanceof Number ) { tableRecords . add ( new Form ( ( ( Number ) formFieldValue ) . longValue ( ) ) ) ; } if ( tableRecords . isEmpty ( ) ) { return null ; } fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , new TableField ( tableRecords ) , type ) ; break ; case Text : case ParagraphText : if ( formFieldValue instanceof String ) { // Latitude and Longitude storage . . .
if ( LATITUDE_AND_LONGITUDE . equals ( this . getTypeMetaData ( ) ) ) { String formFieldValueStr = formFieldValue . toString ( ) ; UtilGlobal utilGlobal = new UtilGlobal ( ) ; double latitude = utilGlobal . getLatitudeFromElasticSearchText ( formFieldValueStr ) ; double longitude = utilGlobal . getLongitudeFromElasticSearchText ( formFieldValueStr ) ; String newFieldVal = ( latitude + UtilGlobal . PIPE + longitude + UtilGlobal . PIPE ) ; fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , newFieldVal , type ) ; } else { // Other . . .
fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , formFieldValue . toString ( ) , type ) ; } } break ; case TrueFalse : if ( formFieldValue instanceof Boolean ) { fieldToAdd = new Field ( this . getId ( ) , this . getFieldName ( ) , formFieldValue , type ) ; } break ; } return fieldToAdd ;


signature:
public class Field { /** * Not allowed to call this method .
 * @ param jsonObjectParam The JSON object to populate from .
 * @ param formFieldsParam The Form Fields to use .
 * @ throws JSONException Never .
 * @ throws FluidElasticSearchException Always .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public void populateFromElasticSearchJson ( JSONObject jsonObjectParam , List < Field > formFieldsParam ) throws JSONException { } }

implementation: throw new FluidElasticSearchException ( "Method not implemented. Make use of 'populateFromElasticSearchJson(JSONObject jsonObjectParam)' method." ) ;


signature:
public class Field { /** * Returns the ElasticSearch equivalent data field - type from the Fluid datatype .
 * @ return ElasticSearch field - type .
 * @ see ElasticSearchType */
@ XmlTransient public String getElasticSearchFieldType ( ) { } }

implementation:
Type fieldType = this . getTypeAsEnum ( ) ; if ( fieldType == null ) { return null ; } // Get the fieldType by Fluid field fieldType . . .
switch ( fieldType ) { case ParagraphText : return ElasticSearchType . TEXT ; case Text : String metaData = this . getTypeMetaData ( ) ; if ( metaData == null || metaData . isEmpty ( ) ) { return ElasticSearchType . TEXT ; } if ( LATITUDE_AND_LONGITUDE . equals ( metaData ) ) { return ElasticSearchType . GEO_POINT ; } return ElasticSearchType . TEXT ; case TrueFalse : return ElasticSearchType . BOOLEAN ; case DateTime : return ElasticSearchType . DATE ; case Decimal : return ElasticSearchType . DOUBLE ; case MultipleChoice : return ElasticSearchType . KEYWORD ; } return null ;


signature:
public class Field { /** * Checks whether the provided { @ code fieldParam } qualifies for
 * insert into Elastic Search .
 * @ return Whether the Field Qualifies . */
private boolean doesFieldQualifyForElasticSearchInsert ( ) { } }

implementation:
// Test Value . . .
Field . Type fieldType ; if ( ( ( this . getFieldValue ( ) ) == null ) || ( ( fieldType = this . getTypeAsEnum ( ) ) == null ) ) { return false ; } // Test the Name . . .
if ( this . getFieldName ( ) == null || this . getFieldName ( ) . trim ( ) . isEmpty ( ) ) { return false ; } // Confirm the fieldType is supported . . .
switch ( fieldType ) { case DateTime : case Decimal : case MultipleChoice : case Table : case Text : case ParagraphText : case TrueFalse : case TextEncrypted : return true ; default : return false ; }


signature:
public class AccessTokenRequest { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AccessTokenRequest }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Client ID . . .
if ( this . getClientId ( ) != null ) { returnVal . put ( JSONMapping . CLIENT_ID , this . getClientId ( ) ) ; } // Client Secret . . .
if ( this . getClientSecret ( ) != null ) { returnVal . put ( JSONMapping . CLIENT_SECRET , this . getClientSecret ( ) ) ; } // Code . . .
if ( this . getCode ( ) != null ) { returnVal . put ( JSONMapping . CODE , this . getCode ( ) ) ; } // Grant Type . . .
if ( this . getGrantType ( ) != null ) { returnVal . put ( JSONMapping . GRANT_TYPE , this . getGrantType ( ) ) ; } // Redirect URI . . .
if ( this . getRedirectUri ( ) != null ) { returnVal . put ( JSONMapping . REDIRECT_URI , this . getRedirectUri ( ) ) ; } return returnVal ;


signature:
public class FlowStep { /** * Sets the property value of the step with
 * property name { @ code nameParam } .
 * @ param nameParam The property name .
 * @ param valueParam The property value . */
public void setStepProperty ( String nameParam , String valueParam ) { } }

implementation: if ( this . getStepProperties ( ) == null ) { this . setStepProperties ( new ArrayList ( ) ) ; } if ( nameParam == null || nameParam . trim ( ) . isEmpty ( ) ) { return ; } if ( valueParam . trim ( ) . isEmpty ( ) ) { return ; } String paramLower = nameParam . toLowerCase ( ) ; for ( StepProperty existingProp : this . getStepProperties ( ) ) { if ( existingProp . getName ( ) . toLowerCase ( ) . equals ( paramLower ) ) { existingProp . setValue ( valueParam ) ; return ; } } this . getStepProperties ( ) . add ( new StepProperty ( nameParam , valueParam ) ) ;


signature:
public class FlowStep { /** * Gets the step property with name { @ code nameParam }
 * @ param nameParam The property to retrieve .
 * @ return Value of the property with name { @ code nameParam } . */
public String getStepProperty ( String nameParam ) { } }

implementation: if ( this . getStepProperties ( ) == null || this . getStepProperties ( ) . isEmpty ( ) ) { return null ; } if ( nameParam == null || nameParam . trim ( ) . isEmpty ( ) ) { return null ; } String paramLower = nameParam . toLowerCase ( ) ; for ( StepProperty stepProperty : this . getStepProperties ( ) ) { if ( stepProperty . getName ( ) . toLowerCase ( ) . equals ( paramLower ) ) { return stepProperty . getValue ( ) ; } } return null ;


signature:
public class FlowStep { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FlowStep }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } // Flow . . .
if ( this . getFlow ( ) != null ) { returnVal . put ( JSONMapping . FLOW , this . getFlow ( ) . toJsonObject ( ) ) ; } // Flow Step Type . . .
if ( this . getFlowStepType ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_TYPE , this . getFlowStepType ( ) ) ; } // Flow Step Parent Id . . .
if ( this . getFlowStepParentId ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_PARENT_ID , this . getFlowStepParentId ( ) ) ; } // Entry Rules . . .
if ( this . getEntryRules ( ) != null && ! this . getEntryRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getEntryRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ENTRY_RULES , jsonArray ) ; } // Exit Rules . . .
if ( this . getExitRules ( ) != null && ! this . getExitRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getExitRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . EXIT_RULES , jsonArray ) ; } // View Rules . . .
if ( this . getViewRules ( ) != null && ! this . getViewRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getViewRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . VIEW_RULES , jsonArray ) ; } // Step Properties . . .
if ( this . getStepProperties ( ) != null && ! this . getStepProperties ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( StepProperty stepProperty : this . getStepProperties ( ) ) { jsonArray . put ( stepProperty . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . STEP_PROPERTIES , jsonArray ) ; } return returnVal ;


signature:
public class AuthRequest { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AuthRequest }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Username . . .
if ( this . getUsername ( ) != null ) { returnVal . put ( JSONMapping . USERNAME , this . getUsername ( ) ) ; } // Lifetime . . .
if ( this . getLifetime ( ) != null ) { returnVal . put ( JSONMapping . LIFETIME , this . getLifetime ( ) ) ; } return returnVal ;


signature:
public class FlowStepClient { /** * Creates a new Flow Step .
 * @ param flowStepParam The step to create .
 * @ return The created step . */
public FlowStep createFlowStep ( FlowStep flowStepParam ) { } }

implementation: if ( flowStepParam != null && this . serviceTicket != null ) { flowStepParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStep ( this . putJson ( flowStepParam , WS . Path . FlowStep . Version1 . flowStepCreate ( ) ) ) ;