public static class NacAlarm.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Builder(android.content.Context context) |
Builder(android.os.Parcel input)
Populate values with input parcel.
|
Modifier and Type | Method and Description |
---|---|
NacAlarm |
build()
Build the alarm.
|
java.lang.String |
getAudioSource() |
java.util.EnumSet<com.nfcalarmclock.util.NacCalendar.Day> |
getDays() |
boolean |
getEnabled() |
int |
getHour() |
int |
getId() |
java.lang.String |
getMediaPath() |
java.lang.String |
getMediaTitle() |
int |
getMediaType() |
int |
getMinute() |
java.lang.String |
getName() |
java.lang.String |
getNfcTagId() |
NacAlarm.OnAlarmChangeListener |
getOnAlarmChangeListener() |
boolean |
getRepeat() |
boolean |
getUseNfc() |
boolean |
getVibrate() |
int |
getVolume() |
boolean |
isActive() |
NacAlarm.Builder |
setAudioSource(java.lang.String source)
Set the audio source.
|
NacAlarm.Builder |
setDays(java.util.EnumSet<com.nfcalarmclock.util.NacCalendar.Day> days)
Set the days to the run the alarm.
|
NacAlarm.Builder |
setDays(int value) |
NacAlarm.Builder |
setEnabled(boolean enabled)
Set whether the alarm is enabled or not.
|
NacAlarm.Builder |
setHour(int hour)
Set the hour.
|
NacAlarm.Builder |
setId(int id)
Set the alarm ID.
|
NacAlarm.Builder |
setIsActive(boolean active)
Set the flag indicating whether the alarm is active or not.
|
NacAlarm.Builder |
setMedia(android.content.Context context,
java.lang.String path)
Set the path, name, and type of the sound to play.
|
NacAlarm.Builder |
setMediaPath(java.lang.String path)
Set the sound to play when the alarm goes off.
|
NacAlarm.Builder |
setMediaTitle(java.lang.String title)
Set the media title.
|
NacAlarm.Builder |
setMediaType(int type)
Set the type of sound to play.
|
NacAlarm.Builder |
setMinute(int minute)
Set the minute.
|
NacAlarm.Builder |
setName(java.lang.String name)
Set the name of the alarm.
|
NacAlarm.Builder |
setNfcTagId(java.lang.String tagId)
Set the NFC tag ID of the tag that will be used to dismiss the alarm.
|
NacAlarm.Builder |
setOnAlarmChangeListener(NacAlarm.OnAlarmChangeListener listener)
Set the listener for when the alarm is changed.
|
NacAlarm.Builder |
setRepeat(boolean repeat)
Set whether the alarm should repeat every week or not.
|
NacAlarm.Builder |
setUseNfc(boolean useNfc)
Set whether the alarm should use NFC to dismiss or not.
|
NacAlarm.Builder |
setVibrate(boolean vibrate)
Set whether the alarm should vibrate the phone or not.
|
NacAlarm.Builder |
setVolume(int volume)
Set the volume level.
|
public Builder()
public Builder(android.content.Context context)
public Builder(android.os.Parcel input)
public NacAlarm build()
public java.util.EnumSet<com.nfcalarmclock.util.NacCalendar.Day> getDays()
public java.lang.String getAudioSource()
public boolean getEnabled()
public int getHour()
public int getId()
public int getMinute()
public java.lang.String getName()
public NacAlarm.OnAlarmChangeListener getOnAlarmChangeListener()
public boolean getRepeat()
public java.lang.String getMediaPath()
public java.lang.String getMediaTitle()
public int getMediaType()
public java.lang.String getNfcTagId()
public boolean getUseNfc()
public boolean getVibrate()
public int getVolume()
public boolean isActive()
public NacAlarm.Builder setAudioSource(java.lang.String source)
source
- The audio source.public NacAlarm.Builder setDays(java.util.EnumSet<com.nfcalarmclock.util.NacCalendar.Day> days)
days
- The set of days to run the alarm on.public NacAlarm.Builder setDays(int value)
setDays(EnumSet)
public NacAlarm.Builder setEnabled(boolean enabled)
enabled
- True if the alarm is enabled and False otherwise.public NacAlarm.Builder setHour(int hour)
hour
- The hour at which to run the alarm.public NacAlarm.Builder setId(int id)
id
- The unique ID of the alarm.public NacAlarm.Builder setIsActive(boolean active)
active
- The flag indicating active or not.public NacAlarm.Builder setMedia(android.content.Context context, java.lang.String path)
context
- The application context.path
- The path to the sound to play.public NacAlarm.Builder setMediaTitle(java.lang.String title)
title
- The title of the media file to play.public NacAlarm.Builder setMediaPath(java.lang.String path)
path
- The path to the media file to play when the alarm goes
off.public NacAlarm.Builder setMediaType(int type)
type
- The type of media file to play.public NacAlarm.Builder setMinute(int minute)
minute
- The minute at which to run the alarm.public NacAlarm.Builder setName(java.lang.String name)
name
- The alarm name.public NacAlarm.Builder setNfcTagId(java.lang.String tagId)
tagId
- The ID of the NFC tag.public NacAlarm.Builder setOnAlarmChangeListener(NacAlarm.OnAlarmChangeListener listener)
listener
- The on alarm change listener.public NacAlarm.Builder setRepeat(boolean repeat)
repeat
- True if repeating the alarm after it runs, and False
otherwise.public NacAlarm.Builder setUseNfc(boolean useNfc)
useNfc
- True if the phone should use NFC to dismiss, and False
otherwise.public NacAlarm.Builder setVibrate(boolean vibrate)
vibrate
- True if the phone should vibrate when the alarm is
going off and false otherwise.public NacAlarm.Builder setVolume(int volume)
volume
- The volume level.