-
-
Save h2000/1699280 to your computer and use it in GitHub Desktop.
Eclipse Java code templates for google guava collections functionality
This file contains 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
${retIt:newType(java.lang.Iterable)}<${iterable_type}> ${name:newName(retIt)} = ${itbls:newType(com.google.common.collect.Iterables)}.filter(${iterable}, new ${pred:newType(com.google.common.base.Predicate)}<${iterable_type}>() { | |
@Override public boolean apply(${iterable_type} ${input}) { | |
return ${false}; | |
} | |
}); |
This file contains 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
new ${fun:newType(com.google.common.base.Function)}<${from_type}, ${to_type}>() { | |
@Override public ${to_type} apply(${from_type} ${input}) { | |
return ${cursor}; | |
} | |
} |
This file contains 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
new ${pred:newType(com.google.common.base.Predicate)}<${type}>() { | |
@Override public boolean apply(${type} ${input}) { | |
return ${cursor}; | |
} | |
} |
This file contains 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
${retIt:newType(java.lang.Iterable)}<${to_type}> ${name:newName(retIt)} = ${itbls:newType(com.google.common.collect.Iterables)}.transform(${iterable}, new ${fun:newType(com.google.common.base.Function)}<${iterable_type}, ${to_type}>() { | |
@Override public ${to_type} apply(${iterable_type} ${input}) { | |
return ${null}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment