hollow/src/main/java/com/netflix/hollow/core/index/FieldPaths.java
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;
    }
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;
    }
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.

@param dataset the data set
@param type the type name from which to bind the field path
@param path the symbolic field path
@return the field path
@throws IllegalArgumentException if the symbolic field path is ill-formed and cannot be bound
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 .