Solved Check if a author name equals Test

Discussion in 'Spigot Plugin Development' started by FroZenKeyboard, Apr 15, 2017.

  1. How would i check if a Author name is equal to "Test"?
     
  2. if(string.equalsIgnoreCase("Test"))
     
  3. Nvm, found it out.

    Here's the code:

    if(!this.getDescription().getAuthors().equals("Test")) {
    // Do your thing :)
     
  4. Mas

    Mas

    Apologies for posting on a 'solved' thread, but:
    PluginDescriptionFile#getAuthors() returns a List<String> so you'll need to see if that list contains "Test", and not compare it to the list itself.
     
  5. Something similar to this:
    Code (Text):
    for(String author : getAuthors()){
      if(author.equalsIgnoreCase("test")){
      // do stuff
    }