Iterative

This commit is contained in:
Matthew Cech
2020-02-09 20:56:10 -08:00
parent c8061770ed
commit de2f3f4515
8 changed files with 206 additions and 24 deletions
+33 -16
View File
@@ -1,40 +1,57 @@
package dataStructures;
// This is a structure representing an image reponse for handing around.
import java.awt.Color;
// This is a structure representing an image response for handing around.
public class GenericImage
{
private String artist;
private String postURL;
private String imageURL;
private KittyEmbed response= new KittyEmbed();
public GenericImage(String artist, String postURL, String imageURL)
{
this.artist = artist;
this.postURL = postURL;
this.imageURL = imageURL;
response.authorText = null;
response.color = new Color(0,0,0);
}
public void editArtist(String artist)
{
this.artist = artist;
response.authorText = artist;
}
public void editAuthorImage(String URL)
{
response.authorImage = URL;
}
public void editPostURL(String postURL)
{
this.postURL = postURL;
response.authorLink = postURL;
}
public void editImageURL(String imageURL)
{
this.imageURL = imageURL;
response.imageURL = imageURL;
}
public String toString()
public void editDescriptionText(String score)
{
if(imageURL.isEmpty())
{
return "I couldn't find anything! Please try again!";
}
return "Artist: " + artist + "\n<" + postURL.trim() + ">\n" + imageURL;
response.descriptionText = score;
}
public void editFooterText(String tags)
{
response.footerText = tags;
}
public KittyEmbed output()
{
return response;
}
public boolean isValid()
{
if(response.title != null)
return true;
return false;
}
}