public < T > T giveOther ( TypeTag tag , T value ) { Class < T > type = tag . getType ( ) ; if ( value != null && ! type . isAssignableFrom ( value . getClass ( ) ) && ! wraps ( type , value . getClass ( ) ) ) { throw new ReflectionException ( "TypeTag does not match value." ) ; } Tuple < T > tuple = giveTuple ( tag ) ; if ( tuple . getRed ( ) == null ) { return null ; } if ( type . isArray ( ) && arraysAreDeeplyEqual ( tuple . getRed ( ) , value ) ) { return tuple . getBlack ( ) ; } if ( ! type . isArray ( ) && tuple . getRed ( ) . equals ( value ) ) { return tuple . getBlack ( ) ; } return tuple . getRed ( ) ; }
Returns a prefabricated value of the specified type that is different from the specified value .