FileBasedSource extends OffsetBasedSource<T> { @Override public String toString() { switch (mode) { case FILEPATTERN: return fileOrPatternSpec.toString(); case SINGLE_FILE_OR_SUBRANGE: return fileOrPatternSpec + " range " + super.toString(); default: throw new IllegalStateException("Unexpected mode: " + mode); } } protected  FileBasedSource(
      ValueProvider<String> fileOrPatternSpec,
      EmptyMatchTreatment emptyMatchTreatment,
      long minBundleSize); protected  FileBasedSource(ValueProvider<String> fileOrPatternSpec, long minBundleSize); protected  FileBasedSource(
      Metadata fileMetadata, long minBundleSize, long startOffset, long endOffset); final MatchResult.Metadata getSingleFileMetadata(); final String getFileOrPatternSpec(); final ValueProvider<String> getFileOrPatternSpecProvider(); final EmptyMatchTreatment getEmptyMatchTreatment(); final Mode getMode(); @Override final FileBasedSource<T> createSourceForSubrange(long start, long end); @Override final long getEstimatedSizeBytes(PipelineOptions options); @Override void populateDisplayData(DisplayData.Builder builder); @Override final List<? extends FileBasedSource<T>> split(
      long desiredBundleSizeBytes, PipelineOptions options); @Override final BoundedReader<T> createReader(PipelineOptions options); @Override String toString(); @Override void validate(); @Override final long getMaxEndOffset(PipelineOptions options);  }
@Test public void testToStringFile() throws Exception { File f = createFileWithData("foo", Collections.emptyList()); Metadata metadata = FileSystems.matchSingleFileSpec(f.getPath()); TestFileBasedSource source = new TestFileBasedSource(metadata, 1, 0, 10, null); assertEquals(String.format("%s range [0, 10)", f.getAbsolutePath()), source.toString()); }