Changeset 772


Ignore:
Timestamp:
09/05/12 15:53:38 (12 years ago)
Author:
sherbold
Message:
  • updated QuestPlugin? API and implementing plug-ins to ensure that the internal representation is immutable from the outside.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-core-test/src/test/java/de/ugoe/cs/quest/plugin/PluginLoaderTest.java

    r766 r772  
    22 
    33import java.io.File; 
     4import java.util.Arrays; 
    45import java.util.Collection; 
    56 
     
    169170                assertNotNull(plugin); 
    170171                assertEquals("Mock Plugin", plugin.getTitle()); 
    171                 assertArrayEquals(new String[]{"de.ugoe.cs.quest.plugin.mock.commands"}, plugin.getCommandPackages()); 
     172                assertEquals(Arrays.asList(new String[]{"de.ugoe.cs.quest.plugin.mock.commands"}), plugin.getCommandPackages()); 
    172173        } 
    173174         
  • trunk/quest-plugin-core/src/main/java/de/ugoe/cs/quest/plugin/QuestPlugin.java

    r514 r772  
    11package de.ugoe.cs.quest.plugin; 
     2 
     3import java.util.List; 
    24 
    35/** 
     
    2224        /** 
    2325         * <p> 
    24          * Collection of {@link String}s that contain the commands defined by this 
    25          * plug-in. 
     26         * {@link List} of {@link String}s that contain the commands defined by this 
     27         * plug-in. The List is immutable. 
    2628         * </p> 
    2729         * <p> 
     
    3234         * @return 
    3335         */ 
    34         public String[] getCommandPackages(); 
     36        public List<String> getCommandPackages(); 
    3537} 
  • trunk/quest-plugin-guitar/src/main/java/de/ugoe/cs/quest/plugin/guitar/GUITARPlugin.java

    r516 r772  
    11package de.ugoe.cs.quest.plugin.guitar; 
     2 
     3import java.util.Arrays; 
     4import java.util.Collections; 
     5import java.util.List; 
    26 
    37import de.ugoe.cs.quest.plugin.QuestPlugin; 
     
    3640         */ 
    3741        @Override 
    38         public String[] getCommandPackages() { 
    39                 return commandPackages; 
     42        public List<String> getCommandPackages() { 
     43                return Collections.unmodifiableList(Arrays.asList(commandPackages)); 
    4044        } 
    4145 
  • trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCPlugin.java

    r655 r772  
    11package de.ugoe.cs.quest.plugin.jfc; 
     2 
     3import java.util.Arrays; 
     4import java.util.Collections; 
     5import java.util.List; 
    26 
    37import de.ugoe.cs.quest.plugin.QuestPlugin; 
     
    3741     */ 
    3842    @Override 
    39     public String[] getCommandPackages() { 
    40         return commandPackages; 
     43    public List<String> getCommandPackages() { 
     44        return Collections.unmodifiableList(Arrays.asList(commandPackages)); 
    4145    } 
    4246 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/MFCPlugin.java

    r516 r772  
    11package de.ugoe.cs.quest.plugin.mfc; 
     2 
     3import java.util.Arrays; 
     4import java.util.Collections; 
     5import java.util.List; 
    26 
    37import de.ugoe.cs.quest.plugin.QuestPlugin; 
     
    3640         */ 
    3741        @Override 
    38         public String[] getCommandPackages() { 
    39                 return commandPackages; 
     42        public List<String> getCommandPackages() { 
     43                return Collections.unmodifiableList(Arrays.asList(commandPackages)); 
    4044        } 
    4145 
  • trunk/quest-plugin-php/src/main/java/de/ugoe/cs/quest/plugin/php/PHPPlugin.java

    r516 r772  
    11package de.ugoe.cs.quest.plugin.php; 
     2 
     3import java.util.Arrays; 
     4import java.util.Collections; 
     5import java.util.List; 
    26 
    37import de.ugoe.cs.quest.plugin.QuestPlugin; 
     
    3640         */ 
    3741        @Override 
    38         public String[] getCommandPackages() { 
    39                 return commandPackages; 
     42        public List<String> getCommandPackages() { 
     43                return Collections.unmodifiableList(Arrays.asList(commandPackages)); 
    4044        } 
    41  
    4245} 
Note: See TracChangeset for help on using the changeset viewer.