Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit cloning #52

Open
robertvazan opened this issue Jun 6, 2018 · 3 comments
Open

Hit cloning #52

robertvazan opened this issue Jun 6, 2018 · 3 comments
Milestone

Comments

@robertvazan
Copy link

My hit processing pipeline sometimes needs to send the same or slightly modified hit to another property. I could use correct public implementation of the clone() method on GoogleAnalyticsRequest that would return T.

brsanthu added a commit that referenced this issue May 19, 2019
brsanthu added a commit that referenced this issue May 19, 2019
@brsanthu brsanthu added this to the 2.1 milestone May 20, 2019
@brsanthu
Copy link
Owner

Added deepClone which returns new instance of same type. Didn't want to use standard clone as it returns object and users would have to type cast again.

@robertvazan
Copy link
Author

AFAIK, Java allows you to narrow return types in derived classes. You can override it as public T clone() even though Object declares it as protected Object clone() throws CloneNotSupportedException.

@brsanthu
Copy link
Owner

Looks like it would work. So I will rename deepClone to clone and implement Cloneable

brsanthu added a commit that referenced this issue May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants