(final Scope scope)
| 189 | } |
| 190 | |
| 191 | public static Scoping forInstance(final Scope scope) { |
| 192 | if (scope == Scopes.SINGLETON) { |
| 193 | return SINGLETON_INSTANCE; |
| 194 | } else if (scope == Scopes.NO_SCOPE) { |
| 195 | return EXPLICITLY_UNSCOPED; |
| 196 | } |
| 197 | |
| 198 | return new Scoping() { |
| 199 | @Override |
| 200 | public <V> V acceptVisitor(BindingScopingVisitor<V> visitor) { |
| 201 | return visitor.visitScope(scope); |
| 202 | } |
| 203 | |
| 204 | @Override |
| 205 | public Scope getScopeInstance() { |
| 206 | return scope; |
| 207 | } |
| 208 | |
| 209 | @Override |
| 210 | public String toString() { |
| 211 | return scope.toString(); |
| 212 | } |
| 213 | |
| 214 | @Override |
| 215 | public void applyTo(ScopedBindingBuilder scopedBindingBuilder) { |
| 216 | scopedBindingBuilder.in(scope); |
| 217 | } |
| 218 | }; |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Returns true if this scope was explicitly applied. If no scope was explicitly applied then the |
no outgoing calls
no test coverage detected