/** * Reads all characters from uri, using the given character set. * It throws an unchecked exception if an error occurs. */ public String readString(URI uri, Charset charset) { return searchForSupportedProcessor(uri).readString(uri, charset); }
/** * Reads all bytes from uri. It throws an unchecked exception if an error occurs. */ public byte[] readBytes(URI uri) { return searchForSupportedProcessor(uri).readBytes(uri); }
/** * Returns a detailed description of the given uri. For example HTTP URIs are completed * with the configured HTTP proxy. */ public String description(URI uri) { SchemeProcessor reader = searchForSupportedProcessor(uri); return reader.description(uri); }
public Node(final Object object) { if (object == null) { throw new SonarException("object can not be null"); } this.object = object; }
/** * @since 2.7 */ public static String formatIntString(Map<Integer, String> map) { return format(map, newIntegerConverter(), newStringConverter()); }
/** * @since 2.7 */ public static String formatIntDouble(Map<Integer, Double> map) { return format(map, newIntegerConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static String formatIntDateTime(Map<Integer, Date> map) { return format(map, newIntegerConverter(), newDateTimeConverter()); }
/** * Subtract the given duration to the current one. */ public Duration subtract(Duration with) { return Duration.create(durationInMinutes - with.durationInMinutes); }
/** * @since 2.7 */ public static String format(Map map) { return format(map, newToStringConverter(), newToStringConverter()); }
/** * Parses a string with the default locale and returns the corresponding number * * @throws ParseException if number cannot be parsed */ public static double parseNumber(String number) throws ParseException { return parseNumber(number, Locale.ENGLISH); }
/** * Unzip a file into a directory. The directory is created if it does not exist. * * @return the target directory */ public static File unzip(File zip, File toDir) throws IOException { return unzip(zip, toDir, (Predicate<ZipEntry>) ze -> true); }
@Override public String toString() { return ABSOLUTE_PATH_PATTERN_PREFIX + pattern.toString(); } }
/** * Return the string value of the Duration. * <br> * Example : encode(Duration.encode("9d 10h")) -> "10d2h" */ public String encode(Duration duration) { return duration.encode(HOURS_IN_DAY); }
Subclass s = new SubClass(); s.getNb(); //returns 1 s.getNb2(); //returns 3 SuperClass sup = new SuperClass(); sup.getNb(); //returns 1 sup.getNb2(); //returns 2
@Override public boolean test(ZipEntry zipEntry) { return delegate.accept(zipEntry); } }
/** * Create a Duration from a number of minutes. */ public static Duration create(long durationInMinutes) { return new Duration(durationInMinutes); }
/** * Multiply the duration with the given factor. */ public Duration multiply(int factor) { return Duration.create(durationInMinutes * factor); }
@Override public String toString() { return pattern.toString(); } }
/** * Create a Duration object from a number of minutes */ public Duration create(long minutes) { return Duration.create(minutes); }
/** * Add the given duration to the current one. */ public Duration add(Duration with) { return Duration.create(durationInMinutes + with.durationInMinutes); }