当前位置: 首页>>代码示例>>Java>>正文


Java LocalTime.parse方法代码示例

本文整理汇总了Java中org.threeten.bp.LocalTime.parse方法的典型用法代码示例。如果您正苦于以下问题:Java LocalTime.parse方法的具体用法?Java LocalTime.parse怎么用?Java LocalTime.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.threeten.bp.LocalTime的用法示例。


在下文中一共展示了LocalTime.parse方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Lesson

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
public Lesson(@NonNull String syncId, Schedule schedule, DayOfWeek weekday, boolean isGroupSchedule) {
    this._id = null;
    this.syncId = syncId;
    this.auditoryList = schedule.auditory;
    this.employeeList = schedule.employee;
    String[] lessonTime = TextUtils.split(schedule.lessonTime, "-");
    try {
        this.lessonTimeStart = LocalTime.parse(lessonTime[0]);
        this.lessonTimeEnd = LocalTime.parse(lessonTime[1]);
    } catch (IndexOutOfBoundsException e) {
        Timber.e("Something went wrong: " + e.getMessage());
    }
    this.lessonType = schedule.lessonType;
    this.note = schedule.note;
    this.numSubgroup = schedule.numSubgroup;
    this.studentGroupList = schedule.studentGroup;
    this.subject = schedule.subject;
    this.weekNumberList = schedule.weekNumber;
    this.weekday = weekday;
    this.isGroupSchedule = isGroupSchedule;
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:22,代码来源:Lesson.java

示例2: testSerialization

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
@Test
public void testSerialization() {
    LocalTime localTime = LocalTime.parse("10:34:00");

    String json = gson.toJson(localTime);

    assertEquals(json, "\"10:34:00\"");
}
 
开发者ID:aaronhe42,项目名称:ThreeTen-Backport-Gson-Adapter,代码行数:9,代码来源:LocalTimeConverterTest.java

示例3: mapFromCursor

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
@NonNull @Override public Lesson mapFromCursor(@NonNull Cursor cursor) {
  String[] auditoryArray =
      mGson.fromJson(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_AUDITORY_LIST)),
          String[].class);
  if (auditoryArray == null) {
    auditoryArray = new String[] {};
  }
  Employee[] employeeArray =
      mGson.fromJson(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_EMPLOYEE_LIST)),
          Employee[].class);
  if (employeeArray == null) {
    employeeArray = new Employee[] {};
  }
  String[] studentGroupArray =
      mGson.fromJson(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_STUDENT_GROUP_LIST)),
          String[].class);
  Integer[] weekNumberArray =
      mGson.fromJson(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_WEEK_NUMBER_LIST)),
          Integer[].class);

  return new Lesson(cursor.getLong(cursor.getColumnIndex(LessonEntry._ID)),
      cursor.getString(cursor.getColumnIndex(LessonEntry.COL_SYNC_ID)),
      new ArrayList<>(Arrays.asList(auditoryArray)),
      new ArrayList<>(Arrays.asList(employeeArray)),
      LocalTime.parse(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_LESSON_TIME_START))),
      LocalTime.parse(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_LESSON_TIME_END))),
      cursor.getString(cursor.getColumnIndex(LessonEntry.COL_LESSON_TYPE)),
      cursor.getString(cursor.getColumnIndex(LessonEntry.COL_NOTE)),
      cursor.getInt(cursor.getColumnIndex(LessonEntry.COL_NUM_SUBGROUP)),
      new ArrayList<>(Arrays.asList(studentGroupArray)),
      cursor.getString(cursor.getColumnIndex(LessonEntry.COL_SUBJECT)),
      new ArrayList<>(Arrays.asList(weekNumberArray)),
      DayOfWeek.valueOf(cursor.getString(cursor.getColumnIndex(LessonEntry.COL_WEEKDAY))),
      cursor.getInt(cursor.getColumnIndex(LessonEntry.COL_IS_GROUP_SCHEDULE)) != 0);
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:36,代码来源:LessonStorIOISQLiteGetResolver.java

示例4: getModelValue

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
@Override
public LocalTime getModelValue(String data) {
    if (data == null) {
        return null;
    }
    return LocalTime.parse(data);
}
 
开发者ID:jguerinet,项目名称:MyMartlet,代码行数:8,代码来源:LocalTimeConverter.java

示例5: testSerialisation

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
/**
 * Tests that serialising to JSON works.
 */
@Test
public void testSerialisation() throws Exception
{
  final Gson gson = registerLocalTime(new GsonBuilder()).create();

  final LocalTime localTime = LocalTime.parse("12:56:00");
  final String json = gson.toJson(localTime);

  assertThat(json, is("\"12:56:00\""));
}
 
开发者ID:gkopff,项目名称:gson-threeten-serialisers,代码行数:14,代码来源:LocalTimeConverterTest.java

示例6: parseTime

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
private static LocalTime parseTime(String time) {
  return time.isEmpty() ? null : LocalTime.parse(time, TIME_FORMAT);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:4,代码来源:CoppClarkExchangeFileReader.java

示例7: get

import org.threeten.bp.LocalTime; //导入方法依赖的package包/类
@Override public LocalTime get(@NonNull String key, @NonNull SharedPreferences preferences) {
  return LocalTime.parse(preferences.getString(key, "07:00"));
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:4,代码来源:PreferencesModule.java


注:本文中的org.threeten.bp.LocalTime.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。