/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Constructs an instance from an Object that represents a datetime, * using the specified chronology. * <p> * If the chronology is null, ISO in the default time zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param chronology the chronology * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Constructs an instance from an Object that represents a datetime, * forcing the time zone to that specified. * <p> * If the object contains no chronology, <code>ISOChronology</code> is used. * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param zone the time zone * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, DateTimeZone zone) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); Chronology chronology = converter.getChronology(instant, zone); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Constructs an instance from an Object that represents a datetime, * using the specified chronology. * <p> * If the chronology is null, ISO in the default time zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param chronology the chronology * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Constructs an instance from an Object that represents a datetime, * forcing the time zone to that specified. * <p> * If the object contains no chronology, <code>ISOChronology</code> is used. * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param zone the time zone * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, DateTimeZone zone) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); Chronology chronology = converter.getChronology(instant, zone); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
static BaseLocalConverter<LocalTime> makeLocalTimeConverter(DateTimeFormatter formatter) { return new BaseLocalConverter<LocalTime>(formatter) { private final DateTimeFormatter localFormatter = ISODateTimeFormat.localTimeParser(); protected LocalTime fromString(String value) { return localFormatter.parseLocalTime(value); } protected LocalTime fromLong(long value) { return new LocalTime(value); } }; } }
/** * Constructs an instance from an Object that represents a datetime, * using the specified chronology. * <p> * If the chronology is null, ISO in the default time zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param chronology the chronology * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Constructs an instance from an Object that represents a datetime, * forcing the time zone to that specified. * <p> * If the object contains no chronology, <code>ISOChronology</code> is used. * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param zone the time zone * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, DateTimeZone zone) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); Chronology chronology = converter.getChronology(instant, zone); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
static BaseLocalConverter<LocalTime> makeLocalTimeConverter(DateTimeFormatter formatter) { return new BaseLocalConverter<LocalTime>(formatter) { private final DateTimeFormatter localFormatter = ISODateTimeFormat.localTimeParser(); protected LocalTime fromString(String value) { return localFormatter.parseLocalTime(value); } protected LocalTime fromLong(long value) { return new LocalTime(value); } }; } }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Parses a {@code LocalTime} from the specified string. * <p> * This uses {@link ISODateTimeFormat#localTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static LocalTime parse(String str) { return parse(str, ISODateTimeFormat.localTimeParser()); }
/** * Constructs an instance from an Object that represents a datetime, * using the specified chronology. * <p> * If the chronology is null, ISO in the default time zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param chronology the chronology * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }
/** * Constructs an instance from an Object that represents a datetime, * using the specified chronology. * <p> * If the chronology is null, ISO in the default time zone is used. * Once the constructor is completed, the zone is no longer used. * <p> * The recognised object types are defined in * {@link org.joda.time.convert.ConverterManager ConverterManager} and * include ReadablePartial, ReadableInstant, String, Calendar and Date. * The String formats are described by {@link ISODateTimeFormat#localTimeParser()}. * The default String converter ignores the zone and only parses the field values. * * @param instant the datetime object * @param chronology the chronology * @throws IllegalArgumentException if the instant is invalid */ public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }