Class ScaleScrollerDatabase.Converters
- java.lang.Object
-
- edu.cnm.deepdive.scalescroller.service.ScaleScrollerDatabase.Converters
-
- Enclosing class:
- ScaleScrollerDatabase
public static class ScaleScrollerDatabase.Converters extends Object
Provides type converters to translate Java objects into data that can be stored in the SQLite database.
-
-
Constructor Summary
Constructors Constructor Description Converters()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Long
dateToLong(Date value)
Converts aDate
object into a Long.static Mode
integerToMode(Integer value)
Converts an Integer into aMode
object.static Note
integerToNote(Integer value)
Converts an Integer into aNote
object.static Date
longToDate(Long value)
Converts a Long into aDate
object.static Integer
modeToInteger(Mode mode)
Converts aMode
object into an Integer.static Integer
noteToInteger(Note note)
Converts aNote
object into an Integer.
-
-
-
Method Detail
-
dateToLong
public static Long dateToLong(Date value)
Converts aDate
object into a Long.- Parameters:
value
- ADate
object.- Returns:
- A Long.
-
longToDate
public static Date longToDate(Long value)
Converts a Long into aDate
object.- Parameters:
value
- A Long.- Returns:
- A
Date
object.
-
noteToInteger
public static Integer noteToInteger(Note note)
Converts aNote
object into an Integer.- Parameters:
note
- ANote
object.- Returns:
- An Integer.
-
integerToNote
public static Note integerToNote(Integer value)
Converts an Integer into aNote
object.- Parameters:
value
- An Integer.- Returns:
- A
Note
object.
-
modeToInteger
public static Integer modeToInteger(Mode mode)
Converts aMode
object into an Integer.- Parameters:
mode
- AMode
object.- Returns:
- An Integer.
-
-