Reputation: 11
I have seen below code in Scala Redis client.
What does [redis]
will do?
package object redis {
private[redis] trait Reply
private[redis] trait R extends Reply
private[redis] object Commands
}
Upvotes: 1
Views: 388
Reputation: 27356
private[redis]
means that the trait or object is only usable by code inside the redis
package. Code in other packages cannot access the value.
Upvotes: 1
Reputation: 7845
that means a method/class/object/trait is only visible to other classes in the same package.
Is one of the existing scala access levels:
See more details at https://alvinalexander.com/scala/how-to-control-scala-method-scope-object-private-package
Upvotes: 1