Package com.ubs.backend.classes
Class TempAnswer
java.lang.Object
com.ubs.backend.classes.TempAnswer
Class for saving a temporary answer with all tags. used for building JSON objects
- Since:
- 17.07.2021
- Author:
- Tim Irmler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AnswerThe answerprivate intused for tag detail site, if we want to display the amount of downvotes the single tag has on this single answerprivate longone single tag, used to count how many answers are using this tagall the tags this answer hasprivate intused for tag detail site, if we want to display the amount of upvotes the single tag has on this single answerprivate floatthe usefulness of this answer, calculated by the average usefulness of all its tags -
Constructor Summary
ConstructorsConstructorDescriptionTempAnswer(Answer answer)TempAnswer(Answer answer, long mySingleResultTagID)TempAnswer(Answer answer, long mySingleResultTagID, int usefulness)TempAnswer(Answer answer, ArrayList<TempTag> tags)TempAnswer(Answer answer, ArrayList<TempTag> tags, int usefulness) -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod to add a TagintlonggetTags()intfloatvoidincreaseDownvotes(int value)voidincreaseUpvotes(int value)booleanMethod to remove a TagvoidvoidsetDownvotes(int downvotes)voidsetMySingleResultTagID(long mySingleResultTagID)voidvoidsetUpvotes(int upvotes)voidsetUsefulness(float usefulness)toString()
-
Field Details
-
answer
The answer- Since:
- 17.07.2021
- See Also:
Answer
-
tags
all the tags this answer has- Since:
- 17.07.2021
- See Also:
TempTag
-
mySingleResultTagID
private long mySingleResultTagIDone single tag, used to count how many answers are using this tag- Since:
- 17.07.2021
- See Also:
TempTag
-
usefulness
private float usefulnessthe usefulness of this answer, calculated by the average usefulness of all its tags- Since:
- 21.07.2021
-
upvotes
private int upvotesused for tag detail site, if we want to display the amount of upvotes the single tag has on this single answer -
downvotes
private int downvotesused for tag detail site, if we want to display the amount of downvotes the single tag has on this single answer
-
-
Constructor Details
-
TempAnswer
- Parameters:
answer-tags-- Since:
- 17.07.2021
-
TempAnswer
- Parameters:
answer-mySingleResultTagID-- Since:
- 17.07.2021
-
TempAnswer
- Parameters:
answer-- Since:
- 17.07.2021
-
TempAnswer
- Parameters:
tags-usefulness-- Since:
- 21.07.2021
-
TempAnswer
- Parameters:
answer-mySingleResultTagID-usefulness-- Since:
- 21.07.2021
-
-
Method Details
-
getAnswer
- Returns:
- Since:
- 17.07.2021
-
setAnswer
- Parameters:
answer-- Since:
- 17.07.2021
-
getTags
- Returns:
- Since:
- 17.07.2021
-
setTags
- Parameters:
tags- the new List of Tags- Since:
- 17.07.2021
-
addTag
Method to add a Tag- Parameters:
tag- the new Tag- Returns:
- if the Tag was added
- Since:
- 17.07.2021
-
removeTag
Method to remove a Tag- Parameters:
tag- the Tag being removed- Returns:
- if the Tag was removed
- Since:
- 17.07.2021
-
getMySingleResultTagID
public long getMySingleResultTagID()- Returns:
- the ID of the single Tag
- Since:
- 17.07.2021
-
setMySingleResultTagID
public void setMySingleResultTagID(long mySingleResultTagID)- Parameters:
mySingleResultTagID- the ID of the new single Tag- Since:
- 17.07.2021
-
getUsefulness
public float getUsefulness() -
setUsefulness
public void setUsefulness(float usefulness) -
getUpvotes
public int getUpvotes() -
setUpvotes
public void setUpvotes(int upvotes) -
increaseUpvotes
public void increaseUpvotes(int value) -
getDownvotes
public int getDownvotes() -
setDownvotes
public void setDownvotes(int downvotes) -
increaseDownvotes
public void increaseDownvotes(int value) -
toString
-