All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.lang.init.GosuPathEntry Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * Copyright 2014 Guidewire Software, Inc.
 */

package gw.lang.init;

import gw.fs.IDirectory;
import gw.lang.UnstableAPI;

import java.util.List;

@UnstableAPI
public class GosuPathEntry {

  private IDirectory _root;
  private List _srcs;

  /**
   * Constructs a new GosuPathEntry with the specified data.  None of the arguments
   * are allowed to be null.  Typeloader names should be fully-qualified Java class names.
   *
   * @param root the root IDirectory for this path entry
   * @param srcs the set of IDirectories for this entry that should be considered to be source directories
   */
  public GosuPathEntry(IDirectory root, List srcs) {
    if (root == null) {
      throw new IllegalArgumentException("The root argument cannot be null");
    }
    if (srcs == null) {
      throw new IllegalArgumentException("The srcs argument cannot be null");
    }
    _root = root;
    _srcs = srcs;
  }

  /**
   * Returns the root directory for this GosuPathEntry.  This method will never return null.
   *
   * @return the root directory
   */
  public IDirectory getRoot() {
    return _root;
  }

  /**
   * Returns the source directories for this path entry.  This method will never return null.
   *
   * @return the source directories
   */
  public List getSources() {
    return _srcs;
  }

  /**
   * Returns a String representation of this path entry suitable for use in debugging.
   *
   * @return a debug String representation of this object
   */
  public String toDebugString() {
    StringBuilder sb = new StringBuilder();
    sb.append("GosuPathEntry:\n");
    sb.append("  root: ").append(_root.toJavaFile().getAbsolutePath()).append("\n");
    for (IDirectory src : _srcs) {
      sb.append("  src: ").append(src.toJavaFile().getAbsolutePath()).append("\n");
    }
    return sb.toString();
  }

  public String toString() {
    return _root.toString(); 
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy