Created
March 17, 2020 10:07
-
-
Save silver-mixer/5c80c8cebe15e66628b9f13d9ffe1788 to your computer and use it in GitHub Desktop.
isContains method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isContains(Object o1, Object... obj){ | |
for(Object o: obj){ | |
if(o1.equals(o))return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
自分用に作成した2つ目以降の引数に1つ目の引数と一致する値があるか判定するメソッドのスニペット。
報告、継承など一切不要。使用、改変含めご自由にどうぞ。
Bukkitプラグインでの使用例)
isContains(event.getClickedBlock().getType(), Material.STONE, Material.WOOD, Material.BEDROCK)