Class Plant
- java.lang.Object
-
- fi.metropolia.herbreferenceguide.database.Plant
-
- All Implemented Interfaces:
android.os.Parcelable
public class Plant extends java.lang.Object implements android.os.Parcelable
This class defines data variables that can be fetched from database- Since:
- 2022-03-01
-
-
Constructor Summary
Constructors Modifier Constructor Description Plant(int plantId, java.lang.String plantName, java.lang.String plantType, java.lang.String plantNutrition, java.lang.String plantHealthBenefit, java.lang.String plantFoodSuggestion, java.lang.String plantImgSrc)
Constructor for plant classprotected
Plant(android.os.Parcel in)
Constructor to initialize Plant with data from parcel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.java.lang.String
getPlantFoodSuggestion()
Gets plant food suggestionjava.lang.String
getPlantHealthBenefit()
Gets plant health benefitint
getPlantId()
Gets plant idjava.lang.String
getPlantImgSrc()
Gets plant image sourcejava.lang.String
getPlantName()
Gets plant namejava.lang.String
getPlantNutrition()
Gets plant nutritionjava.lang.String
getPlantType()
Gets plant typevoid
writeToParcel(android.os.Parcel parcel, int i)
Writes object data to a parcel
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Plant> CREATOR
Regenerates a Plant object from parcel. Study source and reference from Android Studio and Stack Overflow
-
-
Constructor Detail
-
Plant
public Plant(int plantId, @NotNull java.lang.String plantName, @NotNull java.lang.String plantType, @NotNull java.lang.String plantNutrition, @NotNull java.lang.String plantHealthBenefit, @NotNull java.lang.String plantFoodSuggestion, @NotNull java.lang.String plantImgSrc)
Constructor for plant class- Parameters:
plantId
- defines plant IDplantName
- defines plant nameplantType
- defines plant typeplantNutrition
- defines plant nutrition valueplantHealthBenefit
- defines plant health benefitsplantFoodSuggestion
- defines plant food suggestionsplantImgSrc
- defines plant image source
-
Plant
protected Plant(android.os.Parcel in)
Constructor to initialize Plant with data from parcel- Parameters:
in
- parcel- See Also:
- Stack Overflow: How to send an object from one Android Activity to another using Intents?
-
-
Method Detail
-
getPlantType
@NotNull public java.lang.String getPlantType()
Gets plant type- Returns:
- String plant type
-
getPlantId
@NotNull public int getPlantId()
Gets plant id- Returns:
- int id
-
getPlantName
@NonNull public java.lang.String getPlantName()
Gets plant name- Returns:
- String plant name
-
getPlantNutrition
@NonNull public java.lang.String getPlantNutrition()
Gets plant nutrition- Returns:
- String plant nutrition
-
getPlantHealthBenefit
@NonNull public java.lang.String getPlantHealthBenefit()
Gets plant health benefit- Returns:
- String plant health benefit
-
getPlantFoodSuggestion
@NonNull public java.lang.String getPlantFoodSuggestion()
Gets plant food suggestion- Returns:
- String plant food suggestion
-
getPlantImgSrc
@NonNull public java.lang.String getPlantImgSrc()
Gets plant image source- Returns:
- String plant image source
-
describeContents
public int describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Returns:
- int 0
- See Also:
- Stack Overflow: How to send an object from one Android Activity to another using Intents?
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i)
Writes object data to a parcel- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Parameters:
parcel
- parcel to sendi
- flags- See Also:
- Stack Overflow: How to send an object from one Android Activity to another using Intents?
-
-