public static FieldPath < ObjectFieldSegment > createFieldPathForPrimaryKey ( HollowDataset dataset , String type , String path ) { boolean autoExpand = ! path . endsWith ( "!" ) ; path = autoExpand ? path : path . substring ( 0 , path . length ( ) - 1 ) ; FieldPath < FieldSegment > fp = createFieldPath ( dataset , type , path , autoExpand , false , false ) ; // Erasure trick to avoid copying when it is known the list only contains // instances of ObjectFieldSegment assert fp . segments . stream ( ) . allMatch ( o -> o instanceof ObjectFieldSegment ) ; @ SuppressWarnings ( { "unchecked" , "raw" } ) FieldPath < ObjectFieldSegment > result = ( FieldPath < ObjectFieldSegment > ) ( FieldPath ) fp ; return result ; }
Creates an object - based field path given a data set and the field path in symbolic form conforming to paths associated with a primary key .