<s>[INST] package com.example.robin.angrynerds.models;

import android.util.Log;

import java.util.ArrayList;
import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class Post {
    private String content;
    private String username;
    private String likes;
    private List<Comment> comments;

    public Post(String content, String username) {
        this.content = content;
        this.username = username;
        this.likes = "0";
        this.comments = new ArrayList<>();
    }

    public Post(String content, String username, String likes, List<Comment> comments) {
        this.content = content;
        this.username = username;
        this.likes = likes;
        this.comments = comments;
    }
    //empty constructor
    public Post() {
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getLikes() {
        return likes;
    }

    public void setLikes(String likes) {
        this.likes = likes;
    }

    public List<Comment> getComments() {
        return comments;
    }

    public void setComments(List<Comment> comments) {
        this.comments = comments;
    }

    public void addCommentComment(Comment comment) {
        this.comments.add(comment);
    }

   // public void likePost() {
    //    this.likes += 1;
  //  }

    public void likePost() {
        this.setLikes(String.valueOf(Integer.parseInt(this.getLikes()) + 1));
    }

    public void likePost(int likeIncrement) {
        this.setLikes(String.valueOf(Integer.parseInt(this.getLikes()) + likeIncrement));
    }

    public void removeLike() {
        this.setLikes(String.valueOf(Integer.parseInt(this.getLikes()) - 1));
    }

    public void dislikePost() {
        removeLike();
    }
}
The code seems mostly fine, however I want to add some error handling to the likePost(), likePost(int), and dislikePost() methods. I want to catch the NumberFormatException that occurs if this.getLikes() is not a valid number.
How do you handle this kind of error?[/INST]