Package de.hirola.sportslibrary.model
Class Training
- java.lang.Object
-
- de.hirola.kintojava.model.KintoObject
-
- de.hirola.sportslibrary.PersistentObject
-
- de.hirola.sportslibrary.model.Training
-
- All Implemented Interfaces:
de.hirola.kintojava.model.KintoModel
public class Training extends PersistentObject
Copyright 2021 by Michael Schmidt, Hirola Consulting This software us licensed under the AGPL-3.0 or later. A training session with the bike, the tour is imported as a GPX using an existing recording, saved as a route and visualized with MapKit. The user can store additional information for each training session.- Since:
- 1.1.1
- Author:
- Michael Schmidt (Hirola)
-
-
Constructor Summary
Constructors Constructor Description Training()Default constructor for import from json.Training(@NotNull String name, @Nullable String remarks, @Nullable TrainingType trainingType, @NotNull Track track, @Nullable java.time.LocalDate trainingDate)Training(@NotNull String name, @Nullable String remarks, @Nullable TrainingType trainingType, @Nullable java.time.LocalDate trainingDate, @Nullable Track track, double distance, double averageSpeed, double altitudeDifference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)doublegetAltitudeDifference()Get the name of the training.doublegetAverageSpeed()Get the average speed of the training.doublegetDistance()Get the distance of the training.longgetDuration()Get the duration of the training.List<String>getIdentityAttributeNames()Get a list of all (persistent) attribute names of the objectStringgetName()Get the name of the training.StringgetRemarks()Get the remarks of the training.@Nullable TrackgetTrack()Get the track of the training.java.time.LocalDategetTrainingDate()Get the date of the training.TrainingTypegetTrainingType()Get the type of the training.inthashCode()voidsetAltitudeDifference(double altitudeDifference)Set the altitude difference of training.voidsetAverageSpeed(double averageSpeed)Set the average speed of the training.voidsetDistance(double distance)Set the distance of the training.voidsetDuration(int duration)Set the duration of the training.voidsetName(String name)Set the name of the training.voidsetRemarks(String remarks)Set the remarks of the training.voidsetTrack(Track track)Set the track of the training.voidsetTrainingDate(java.time.LocalDate trainingDate)Set the date of the training.voidsetTrainingType(TrainingType trainingType)Set the type of the training.
-
-
-
Constructor Detail
-
Training
public Training()
Default constructor for import from json.
-
Training
public Training(@NotNull @NotNull String name, @Nullable @Nullable String remarks, @Nullable @Nullable TrainingType trainingType, @NotNull @NotNull Track track, @Nullable @Nullable java.time.LocalDate trainingDate)
-
Training
public Training(@NotNull @NotNull String name, @Nullable @Nullable String remarks, @Nullable @Nullable TrainingType trainingType, @Nullable @Nullable java.time.LocalDate trainingDate, @Nullable @Nullable Track track, double distance, double averageSpeed, double altitudeDifference)
-
-
Method Detail
-
getName
public String getName()
Get the name of the training.- Returns:
- The name of training
-
setName
public void setName(String name)
Set the name of the training.- Parameters:
name- of the training
-
getRemarks
public String getRemarks()
Get the remarks of the training.- Returns:
- The remarks of training
-
setRemarks
public void setRemarks(String remarks)
Set the remarks of the training.- Parameters:
remarks- of the training
-
getTrainingType
public TrainingType getTrainingType()
Get the type of the training.- Returns:
- The type of training
-
setTrainingType
public void setTrainingType(TrainingType trainingType)
Set the type of the training.- Parameters:
trainingType- of the training
-
getTrainingDate
public java.time.LocalDate getTrainingDate()
Get the date of the training.- Returns:
- The date of training
-
setTrainingDate
public void setTrainingDate(java.time.LocalDate trainingDate)
Set the date of the training.- Parameters:
trainingDate- of the training
-
getTrack
@Nullable public @Nullable Track getTrack()
Get the track of the training.- Returns:
- The track of training, can be null
-
setTrack
public void setTrack(Track track)
Set the track of the training.- Parameters:
track- of the training
-
getDuration
public long getDuration()
Get the duration of the training.- Returns:
- The duration of training in minutes
-
setDuration
public void setDuration(int duration)
Set the duration of the training.- Parameters:
duration- of the training in minutes
-
getDistance
public double getDistance()
Get the distance of the training.- Returns:
- The distance of training in meters
-
setDistance
public void setDistance(double distance)
Set the distance of the training.- Parameters:
distance- of the training in meters
-
getAltitudeDifference
public double getAltitudeDifference()
Get the name of the training.- Returns:
- The altitude difference of training in meters
-
setAltitudeDifference
public void setAltitudeDifference(double altitudeDifference)
Set the altitude difference of training.- Parameters:
altitudeDifference- of training in meters
-
getAverageSpeed
public double getAverageSpeed()
Get the average speed of the training.- Returns:
- The average speed of training in km/h
-
setAverageSpeed
public void setAverageSpeed(double averageSpeed)
Set the average speed of the training.- Parameters:
averageSpeed- of the training in km/h
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classde.hirola.kintojava.model.KintoObject
-
hashCode
public int hashCode()
- Overrides:
hashCodein classde.hirola.kintojava.model.KintoObject
-
getIdentityAttributeNames
public List<String> getIdentityAttributeNames()
Description copied from class:PersistentObjectGet a list of all (persistent) attribute names of the object- Specified by:
getIdentityAttributeNamesin classPersistentObject- Returns:
- A list of all (persistent) attribute names of the object
-
-