/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
private boolean isFormatter(Object f) { return (isPrinter(f) || isParser(f)); }
private boolean isFormatter(Object f) { return (isPrinter(f) || isParser(f)); }
/** * Internal method to create a DateTimePrinter instance using all the * appended elements. * <p> * Most applications will not use this method. * If you want a printer in an application, call {@link #toFormatter()} * and just use the printing API. * <p> * Subsequent changes to this builder do not affect the returned printer. * * @throws UnsupportedOperationException if printing is not supported */ public DateTimePrinter toPrinter() { Object f = getFormatter(); if (isPrinter(f)) { InternalPrinter ip = (InternalPrinter) f; return InternalPrinterDateTimePrinter.of(ip); } throw new UnsupportedOperationException("Printing is not supported"); }
/** * Internal method to create a DateTimePrinter instance using all the * appended elements. * <p> * Most applications will not use this method. * If you want a printer in an application, call {@link #toFormatter()} * and just use the printing API. * <p> * Subsequent changes to this builder do not affect the returned printer. * * @throws UnsupportedOperationException if printing is not supported */ public DateTimePrinter toPrinter() { Object f = getFormatter(); if (isPrinter(f)) { InternalPrinter ip = (InternalPrinter) f; return InternalPrinterDateTimePrinter.of(ip); } throw new UnsupportedOperationException("Printing is not supported"); }
/** * Constructs a DateTimeFormatter using all the appended elements. * <p> * This is the main method used by applications at the end of the build * process to create a usable formatter. * <p> * Subsequent changes to this builder do not affect the returned formatter. * <p> * The returned formatter may not support both printing and parsing. * The methods {@link DateTimeFormatter#isPrinter()} and * {@link DateTimeFormatter#isParser()} will help you determine the state * of the formatter. * * @throws UnsupportedOperationException if neither printing nor parsing is supported */ public DateTimeFormatter toFormatter() { Object f = getFormatter(); InternalPrinter printer = null; if (isPrinter(f)) { printer = (InternalPrinter) f; } InternalParser parser = null; if (isParser(f)) { parser = (InternalParser) f; } if (printer != null || parser != null) { return new DateTimeFormatter(printer, parser); } throw new UnsupportedOperationException("Both printing and parsing not supported"); }
/** * Constructs a DateTimeFormatter using all the appended elements. * <p> * This is the main method used by applications at the end of the build * process to create a usable formatter. * <p> * Subsequent changes to this builder do not affect the returned formatter. * <p> * The returned formatter may not support both printing and parsing. * The methods {@link DateTimeFormatter#isPrinter()} and * {@link DateTimeFormatter#isParser()} will help you determine the state * of the formatter. * * @throws UnsupportedOperationException if neither printing nor parsing is supported */ public DateTimeFormatter toFormatter() { Object f = getFormatter(); InternalPrinter printer = null; if (isPrinter(f)) { printer = (InternalPrinter) f; } InternalParser parser = null; if (isParser(f)) { parser = (InternalParser) f; } if (printer != null || parser != null) { return new DateTimeFormatter(printer, parser); } throw new UnsupportedOperationException("Both printing and parsing not supported"); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
private boolean isFormatter(Object f) { return (isPrinter(f) || isParser(f)); }
/** * Internal method to create a DateTimePrinter instance using all the * appended elements. * <p> * Most applications will not use this method. * If you want a printer in an application, call {@link #toFormatter()} * and just use the printing API. * <p> * Subsequent changes to this builder do not affect the returned printer. * * @throws UnsupportedOperationException if printing is not supported */ public DateTimePrinter toPrinter() { Object f = getFormatter(); if (isPrinter(f)) { return (DateTimePrinter) f; } throw new UnsupportedOperationException("Printing is not supported"); }
/** * Constructs a DateTimeFormatter using all the appended elements. * <p> * This is the main method used by applications at the end of the build * process to create a usable formatter. * <p> * Subsequent changes to this builder do not affect the returned formatter. * <p> * The returned formatter may not support both printing and parsing. * The methods {@link DateTimeFormatter#isPrinter()} and * {@link DateTimeFormatter#isParser()} will help you determine the state * of the formatter. * * @throws UnsupportedOperationException if neither printing nor parsing is supported */ public DateTimeFormatter toFormatter() { Object f = getFormatter(); DateTimePrinter printer = null; if (isPrinter(f)) { printer = (DateTimePrinter) f; } DateTimeParser parser = null; if (isParser(f)) { parser = (DateTimeParser) f; } if (printer != null || parser != null) { return new DateTimeFormatter(printer, parser); } throw new UnsupportedOperationException("Both printing and parsing not supported"); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }
/** * Returns true if toPrinter can be called without throwing an * UnsupportedOperationException. * * @return true if a printer can be built */ public boolean canBuildPrinter() { return isPrinter(getFormatter()); }