简体   繁体   中英

Java private method wrapping

I have seen the following pattern used in several frameworks, where a private method is wrapped in a public method:

public Object method_public()
{
   return method_private();
}


private Object method_private()
{
   return Object;
}

What is this pattern called and when should it be used?

Looks like Delegation pattern . But in very strange manner.

http://en.wikipedia.org/wiki/Delegation_pattern

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM