本文整理汇总了Java中com.jadarstudios.developercapes.cape.CapeManager类的典型用法代码示例。如果您正苦于以下问题:Java CapeManager类的具体用法?Java CapeManager怎么用?Java CapeManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CapeManager类属于com.jadarstudios.developercapes.cape包,在下文中一共展示了CapeManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public Group parse (String name, Map<String, Object> data) {
Group group = new Group(name);
Object usersObj = data.get("users");
Object capeUrlObj = data.get("capeUrl");
if (!(usersObj instanceof ArrayList) || !(capeUrlObj instanceof String)) {
DevCapes.logger.error(String.format("Group %s could not be parsed because it either is invalid or missing elements.", name));
return null;
}
ArrayList users = (ArrayList) usersObj;
String capeUrl = (String) capeUrlObj;
group.cape = CapeManager.getInstance().parse(name, capeUrl);
for (Object obj : users) {
User user = UserManager.getInstance().parse((String) obj, group.cape);
if (user != null) group.addUser(user);
}
return group;
}
示例2: parse
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public Group parse(String name, Map<String, Object> data) {
Group group = new Group(name);
Object usersObj = data.get("users");
Object capeUrlObj = data.get("capeUrl");
if (!(usersObj instanceof ArrayList) || !(capeUrlObj instanceof String)) {
DevCapes.logger.error(String.format("Group %s could not be parsed because it either is invalid or missing elements.", name));
return null;
}
ArrayList users = (ArrayList)usersObj;
String capeUrl = (String)capeUrlObj;
group.cape = CapeManager.getInstance().parse(name, capeUrl);
for (Object obj : users) {
User user = UserManager.getInstance().parse((String)obj, group.cape);
if (user != null) {
group.addUser(user);
}
}
return group;
}
示例3: parse
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public User parse (String user, Object cape) {
User userInstance = new User(user);
ICape capeInstance = (cape instanceof ICape) ? (ICape) cape : CapeManager.getInstance().parse(user, cape.toString());
if (capeInstance != null)
userInstance.capes.add(capeInstance);
else
DevCapes.logger.error(String.format("Error parsing cape, %s", cape.toString()));
return userInstance;
}
示例4: addGroup
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup (Group group) {
groups.put(group.name, group);
try {
UserManager.getInstance().addUsers(group.users.values());
CapeManager.getInstance().addCape(group.cape);
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: addUser
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
if (user == null || user.username == null || user.username.isEmpty()) {
throw new NullPointerException("Cannot add a null user!");
}
this.users.put(user.username, user);
CapeManager.getInstance().addCapes(user.capes);
}
示例6: parse
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public User parse(String user, Object cape) {
User userInstance = new User(user);
ICape capeInstance = (cape instanceof ICape) ? (ICape)cape : CapeManager.getInstance().parse(user, cape.toString());
if (capeInstance != null) {
userInstance.capes.add(capeInstance);
} else {
DevCapes.logger.error(String.format("Error parsing cape, %s", cape.toString()));
}
return userInstance;
}
示例7: addGroup
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup(Group group) {
groups.put(group.name, group);
try {
UserManager.getInstance().addUsers(group.users.values());
CapeManager.getInstance().addCape(group.cape);
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: addUser
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
if (user == null || user.username == null || user.username.isEmpty()) {
DevCapes.logger.error("Cannot add a null user.");
throw new NullPointerException();
}
this.users.put(user.username, user);
CapeManager.getInstance().addCapes(user.capes);
}
示例9: addGroup
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup(Group group) {
groups.put(group.name, group);
try {
UserManager.getInstance().addUsers(new HashSet<User>(group.users.values()));
CapeManager.getInstance().addCape(group.cape);
} catch (Exception e) {
e.printStackTrace();
}
}
示例10: addUser
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
if (user == null || user.userUUID == null || user.userUUID.isEmpty()) {
throw new NullPointerException("Cannot add a null user!");
}
this.users.put(user.userUUID, user);
CapeManager.getInstance().addCapes(user.capes);
}
示例11: addUser
import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser (User user) throws NullPointerException {
if (user == null || user.userUUID == null || user.userUUID.isEmpty()) throw new NullPointerException("Cannot add a null user!");
this.users.put(user.userUUID, user);
CapeManager.getInstance().addCapes(user.capes);
}